{"openapi":"3.1.0","info":{"title":"Clarent API","version":"0.9.0","description":"Clarents API för bokföring, byråarbete och driftflöden. Produktivitetslagret ger versionssparade konteringsmallar, snabbtexter, personliga favoriter, dimensioner, rapporturval, arbetsinkorg och samlad integrationsstatus. UI och REST använder samma domäntjänster. Lön är alltid spärrad för AI. Skrivande cookieanrop kräver samma Origin. Ett skapat dokument eller bankkvitto innebär inte att leverans eller betalning genomförts."},"servers":[{"url":"/api/v1"}],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"paths":{"/legal/acceptance":{"get":{"operationId":"getUserTermsAcceptances","summary":"Dina personliga villkorsgodkännanden, även före nytt godkännande","security":[{"sessionCookie":[]}],"parameters":[{"name":"id","in":"query","schema":{"type":"string","format":"uuid"},"description":"Ladda ned eget kvitto med exakt villkorstext."}],"responses":{"200":{"description":"Egen historik eller nedladdningsbart JSON-kvitto."},"401":{"description":"Inloggning krävs."},"404":{"description":"Kvittot finns inte för användaren."}}},"post":{"operationId":"acceptUserTerms","summary":"Godkänn aktuell villkorsversion för det inloggade personliga kontot","description":"Kräver verifierad session och samma Origin. Naturligt idempotent per konto och version; första tidpunkt och nätverksuppgifter bevaras vid omförsök. Konto, tid och IP kan inte anges i JSON-innehållet.","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["version","checksum","accepted"],"properties":{"version":{"type":"string"},"checksum":{"type":"string","pattern":"^[a-f0-9]{64}$"},"accepted":{"const":true}}}}}},"responses":{"201":{"description":"Godkännandets kvitto-ID; samma ID vid omförsök."},"403":{"description":"Personligt konto, verifiering eller giltigt Origin saknas."},"422":{"description":"Godkännandet saknas eller version/kontrollsumma stämmer inte."}}}},"/export-jobs":{"get":{"operationId":"listOwnExportJobs","responses":{"200":{"description":"Egna jobb som fortfarande får läsas."},"401":{"description":"Giltig session krävs."},"403":{"description":"Aktuell mänsklig ägare och full arkivbehörighet krävs."},"409":{"description":"Jobbet är inte redo eller har ändrats."},"429":{"description":"Högst tre aktiva jobb per användare."}}},"post":{"operationId":"queueExportJob","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"company"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","agencyId","companyId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"company-files"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","agencyId","companyId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"company-documents"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"selection":{"type":"object","properties":{"scope":{"type":"string","enum":["year","years","all"]},"yearIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"includeUnlinked":{"type":"boolean"},"categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["Kundfakturor","Leverantorsfakturor","Kvitton-och-utlagg","Dokument","Bankfiler","Skattekonto","Bokforingsimport","Lon","Ovrigt"]}},"series":{"type":"string","pattern":"^[A-Z0-9]{1,10}$"},"numberFrom":{"type":"string","pattern":"^[1-9]\\d{0,15}$"},"numberTo":{"type":"string","pattern":"^[1-9]\\d{0,15}$"}},"required":["scope","includeUnlinked","categories"],"additionalProperties":false}},"required":["kind","agencyId","companyId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agency"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","agencyId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"review"},"grantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"yearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","grantId","companyId","yearId"],"additionalProperties":false}]}},"required":["id","target"],"additionalProperties":false}}}},"responses":{"202":{"description":"Beständigt jobb. Samma id och mål återspelar samma jobb."},"401":{"description":"Giltig session krävs."},"403":{"description":"Aktuell mänsklig ägare och full arkivbehörighet krävs."},"409":{"description":"Jobbet är inte redo eller har ändrats."},"429":{"description":"Högst tre aktiva jobb per användare."}}}},"/export-jobs/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"changeExportJob","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"type":"string","enum":["cancel","restart"]}},"required":["action"],"additionalProperties":false}}}},"responses":{"200":{"description":"Eget jobb avbrutet eller startat igen med förnyad åtkomstkontroll."},"401":{"description":"Giltig session krävs."},"403":{"description":"Aktuell mänsklig ägare och full arkivbehörighet krävs."},"409":{"description":"Jobbet är inte redo eller har ändrats."},"429":{"description":"Högst tre aktiva jobb per användare."}}}},"/export-jobs/{id}/download":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadExportJob","description":"Privat strömmande arkiv. Session, ägarskap och databehörigheter prövas igen för varje del. Filen löper ut efter 24 timmar.","responses":{"200":{"description":"Signerad ZIP upp till 4 GiB med extra utrymme för manifest.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Giltig session krävs."},"403":{"description":"Aktuell mänsklig ägare och full arkivbehörighet krävs."},"409":{"description":"Jobbet är inte redo eller har ändrats."},"429":{"description":"Högst tre aktiva jobb per användare."}}}},"/agencies/{agencyId}/companies/{companyId}/setting-templates":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"settingTemplates","summary":"Läs byråns valbara inställningsmallar.","responses":{"200":{"description":"Tillgängliga mallar med avgränsade förval."}}},"post":{"operationId":"actOnSettingTemplate","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"name":{"type":"string","minLength":1,"maxLength":100},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"parts":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["invoices","accounts","series","templates"]}}},"required":["kind","name","fiscalYearId","parts"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"preview"},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"parts":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["invoices","accounts","series","templates"]}}},"required":["kind","templateId","fiscalYearId","parts"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"apply"},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"parts":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["invoices","accounts","series","templates"]}},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","templateId","fiscalYearId","parts","reviewHash"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"type":"string","enum":["previewMany","applyMany"]},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"parts":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["invoices","accounts","series","templates"]}},"targets":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["companyId","fiscalYearId"],"additionalProperties":false}}},"required":["kind","templateId","parts","targets"],"additionalProperties":false}]}}}},"summary":"Spara mall, granska skillnader eller använd granskade förval i bolaget.","responses":{"200":{"description":"Mall, förhandsvisning eller sparad ändring."},"409":{"description":"Inställningarna har ändrats sedan granskning."}}}},"/agencies/{agencyId}/companies/{companyId}/organization-lookup":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"lookupOrganization","summary":"Hämta namn och postadress från Bolagsverkets avgiftsfria register.","description":"Kräver mänsklig identitet, invoice.read, invoice.write och åtkomst till valt kund- eller leverantörsregister. Söker svenska identitetsnummer. Sparar inga registeruppgifter automatiskt. Högst tio försök per användare och bolag under en minut. Sökt nummer skickas i kroppen, aldrig i URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["customer","supplier"]},"country":{"type":"string","const":"SE"},"organizationNumber":{"type":"string","maxLength":30}},"required":["kind","country","organizationNumber"],"additionalProperties":false}}}},"responses":{"200":{"description":"Källa, kontrolltid och en lista av namn-/adressförslag. Tom lista betyder ingen träff."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."},"429":{"description":"För många uppslag. Vänta en minut."},"503":{"description":"Anslutning saknas eller registret svarar inte. Manuell registrering fungerar."}}}},"/agencies/{agencyId}/companies/{companyId}/bank/payment-candidates":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSupplierPaymentCandidates","summary":"Öppna leverantörsfakturor över alla år med separat granskning av valda poster.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"search","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"dueTo","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"dueFrom","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"invoiceDateTo","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"currency","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":10}},{"name":"party","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"paymentRoute","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","file","other"]}},{"name":"paymentIssue","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","approval","draft","reserved","recipient"]}},{"name":"selectedIds","in":"query","required":false,"schema":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices/approvals":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSupplierApprovalQueue","summary":"Sidindelad attestkö med personligt ansvar och beslutshistorik.","parameters":[{"name":"view","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","others","returned","history"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices/{invoiceId}/duplicates":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSupplierInvoiceDuplicates","summary":"Visa högst 20 möjliga dubbletter och konkreta träfforsaker innan attest eller bokföring. Bokföringens egen kontroll gäller fortsatt.","responses":{"200":{"description":"Antal möjliga dubbletter och högst 20 kandidater med internnummer, leverantörsreferens och träff på referens, OCR eller datum/belopp."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/interest/decision":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"recordInterestDecision","summary":"Dokumentera eller återta beslut att avstå från räntefakturering.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deferred":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["invoiceId","deferred","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-payments/review":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"reviewManualInvoicePayments","summary":"Kontrollera bolagsurval och möjliga omatchade bankrader före manuell betalningsbokföring.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["customer","supplier"]},"rows":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amountSEK":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,2})?$"}},"required":["invoiceId","date","amountSEK"],"additionalProperties":false}}},"required":["kind","rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-payments":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getInvoicePaymentHistory","summary":"Filtrerad och sidindelad betalningshistorik över alla fakturaår.","parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["customer","supplier"]}},{"name":"search","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"currency","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":3}},{"name":"party","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"state","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","active","reversed"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":1000000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":40,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/housework/correction-report":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getHouseworkCorrectionReport","summary":"Rättelseunderlag med fakturor, betalningar, beslut och åtgärdsstöd. Ingen myndighetsinlämning.","parameters":[{"name":"invoiceId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["pdf","xlsx","json"]}}],"responses":{"200":{"description":"Rättelseunderlag i valt format"},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/payroll/review":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getPayrollHumanReview","summary":"Lönehistorik och mänskliga granskningsanteckningar med underlagskontroll.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","minimum":2000,"maximum":2099}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx","json"]}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"savePayrollHumanReview","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"year":{"type":"integer","minimum":2000,"maximum":2099},"case":{"type":"string","enum":["history","vacation","manual_gross","recovery","annual","migration"]},"status":{"type":"string","enum":["accepted","blocked","pending"]},"basis":{"type":"string","minLength":10,"maxLength":4000},"sourceHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"previousId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmed":{"type":"boolean","const":true}},"required":["year","case","status","basis","sourceHash","previousId","confirmed"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-opening":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getInvoiceOpening","description":"Fastställ ingående reskontra efter saldoavstämning och granskning. Mänsklig byrååtkomst krävs.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnInvoiceOpening","description":"Fastställ ingående reskontra efter saldoavstämning och granskning. Mänsklig byrååtkomst krävs.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"version":{"type":"number","const":0},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true},"rows":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["customer","supplier"]},"documentType":{"type":"string","enum":["invoice","credit"]},"partyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":"string","minLength":1,"maxLength":80},"originalReference":{"default":"","type":"string","maxLength":80},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"originalTotal":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"},"remaining":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"},"bookSEK":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"},"booked":{"type":"boolean"},"controlAccount":{"default":"","type":"string","pattern":"^(?:\\d{4})?$"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ocr":{"default":"","type":"string","pattern":"^\\d{0,25}$"},"allocations":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^\\d{4}$"},"amount":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"}},"required":["accountCode","amount"],"additionalProperties":false}}},"required":["id","kind","documentType","partyId","reference","invoiceDate","dueDate","currency","originalTotal","remaining","bookSEK","booked","fileId","allocations"],"additionalProperties":false}}},"required":["version","fiscalYearId","startOn","basis","reviewed","rows"],"additionalProperties":false},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["input","reviewHash"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 1048576 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/payroll":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getPayroll","description":"Lön kräver människa med uttrycklig payroll.read/payroll.write. Lönebokföring kräver dessutom ledger.write. AI och worker nekas alla löneuppgifter.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnPayroll","description":"Lön kräver människa med uttrycklig payroll.read/payroll.write. Lönebokföring kräver dessutom ledger.write. AI och worker nekas alla löneuppgifter.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"calendarRange"},"body":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"category":{"type":"string","enum":["sick","vab","parental","vacation","other"]},"hours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"note":{"type":"string","maxLength":300},"vacationKind":{"type":"string","enum":["paid","saved","unpaid"]},"savedYear":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["employeeId","date","category","hours","note"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"useSchedule":{"type":"boolean"},"employeeVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}}},"required":["kind","body","through","weekdays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"wageType"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"code":{"type":"string","pattern":"^[1-9]\\d{1,5}$"},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["regular","gross_deduction","one_off","other_benefit","car_benefit","fuel_benefit","breakfast","meal","full_board","staff_tips","employer_tips","net_addition","net_deduction","salary_exchange","pension"]},"account":{"type":"string","pattern":"^\\d{4}$"},"offsetAccount":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"vacationQualifying":{"type":"boolean"},"pensionQualifying":{"type":"boolean"},"validFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"validThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","minLength":1,"maxLength":500},"active":{"type":"boolean"}},"required":["code","name","kind","account","offsetAccount","vacationQualifying","pensionQualifying","validFrom","validThrough","source","active"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"payrollOpening"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"source":{"type":"string","minLength":1,"maxLength":500},"periods":{"minItems":1,"maxItems":120,"type":"array","items":{"type":"object","properties":{"period":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"gross":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"benefit":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"tax":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"hours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"vacationBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"pensionBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"paidDays":{"type":"integer","minimum":0,"maximum":31}},"required":["period","gross","benefit","tax","hours","vacationBasis","pensionBasis","paidDays"],"additionalProperties":false}}},"required":["employeeId","through","source","periods"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lockPayrollOpening"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"confirmed":{"type":"boolean"}},"required":["kind","id","version","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"payrollCorrection"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"sourceRunId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mode":{"type":"string","enum":["offset","additional","recovery","benefit"]},"correctedGross":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"correctedBenefit":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"correctedIncome":{"type":"object","properties":{"cash":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"pension":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"other":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"car":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"fuel":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"fuelPayment":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["cash","pension","other","car","fuel","fuelPayment"],"additionalProperties":false},"accountOverrides":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["cash","pension","other","car","fuel"]},"account":{"type":"string","pattern":"^\\d{4}$"},"offsetAccount":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["field","account","offsetAccount","basis"],"additionalProperties":false}},"reason":{"type":"string","minLength":1,"maxLength":500},"consentBasis":{"type":"string","maxLength":500},"effectiveDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["sourceRunId","employeeId","mode","correctedGross","correctedBenefit","reason","consentBasis","effectiveDate"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"approvePayrollCorrection"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","minLength":64,"maxLength":64},"confirmed":{"type":"boolean"}},"required":["kind","id","version","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancelPayrollCorrection"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"postPayrollCorrection"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivableAccount":{"type":"string","pattern":"^\\d{4}$"},"confirmed":{"type":"boolean"}},"required":["kind","id","version","fiscalYearId","receivableAccount","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"payrollReport"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"fora"},"period":{"type":"string","pattern":"^2026-(0[1-9]|1[0-2])$"},"employees":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"firstName":{"type":"string","minLength":1,"maxLength":40},"lastName":{"type":"string","minLength":1,"maxLength":40},"fok":{"type":"string","pattern":"^FOK\\d{6}$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"salaryOverride":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"attributablePays":{"maxItems":24,"type":"array","items":{"type":"object","properties":{"period":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["period","amount"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["employeeId","firstName","lastName","fok","from","through","basis"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["type","period","employees","basis"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"certificate"},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"occupation":{"type":"string","minLength":1,"maxLength":500},"employmentType":{"type":"string","enum":["permanent","temporary","probationary"]},"endReason":{"type":"string","minLength":1,"maxLength":500},"weeklyHours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"months":{"maxItems":24,"type":"array","items":{"type":"object","properties":{"period":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"workedHours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"absenceHours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"overtimeHours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["period","workedHours","absenceHours","overtimeHours","basis"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["type","employeeId","from","through","occupation","employmentType","endReason","weeklyHours","months","basis"],"additionalProperties":false}]}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"createPayrollReport"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","minLength":64,"maxLength":64},"confirmed":{"type":"boolean"}},"required":["kind","id","version","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submitPayrollReport"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":1,"maxLength":500}},"required":["kind","id","date","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"vacationAccrual"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"absenceHistory":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"complete":{"type":"boolean"},"basis":{"type":"string","minLength":1,"maxLength":500},"parentalUsed":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"child":{"type":"string","minLength":1,"maxLength":40},"days":{"type":"integer","minimum":0,"maximum":10000}},"required":["child","days"],"additionalProperties":false}},"periods":{"maxItems":250,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"kind":{"type":"string","enum":["sick","work_injury","parental","vab","pregnancy"]},"extent":{"type":"string","enum":["full","partial"]},"singleParent":{"type":"boolean"},"child":{"type":"string","maxLength":40}},"required":["from","through","kind","extent","singleParent","child"],"additionalProperties":false}}},"required":["from","complete","basis","parentalUsed","periods"],"additionalProperties":false},"percentageRule":{"type":"boolean"},"monthlyDayDeduction":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["amount","basis"],"additionalProperties":false},"savedExtensions":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"agreedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":1,"maxLength":500},"year":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["agreedOn","basis","year"],"additionalProperties":false}},"yearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"openingThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"openingWageBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"openingAbsenceWage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"nonQualifying":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["from","through","basis"],"additionalProperties":false}},"wageOverrides":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"runId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"wageBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"absenceWage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["runId","wageBasis","absenceWage","basis"],"additionalProperties":false}},"liabilityDayValue":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"liabilityFeePercent":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"savedTakenBefore":{"type":"boolean"},"saveDays":{"type":"integer","minimum":0,"maximum":50},"basis":{"type":"string","minLength":1,"maxLength":500},"manual":{"type":"object","properties":{"paidDays":{"type":"integer","minimum":0,"maximum":50},"unpaidDays":{"type":"integer","minimum":0,"maximum":50},"vacationPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"dayPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"supplementPerDay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"currentYearLiability":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["paidDays","unpaidDays","vacationPay","dayPay","supplementPerDay"],"additionalProperties":false}},"required":["yearId","through","openingThrough","openingWageBasis","openingAbsenceWage","nonQualifying","wageOverrides","liabilityDayValue","liabilityFeePercent","savedTakenBefore","saveDays","basis"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lockVacationAccrual"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean"}},"required":["kind","id","version","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"closeVacationYear"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean"}},"required":["kind","id","version","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"sickPeriod"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"closed":{"type":"boolean"},"reportedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"eligible":{"type":"boolean"},"declaration":{"type":"boolean"},"certificateThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"exempt":{"type":"boolean"},"exemptionBasis":{"type":"string","maxLength":300},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["employeeId","startsOn","endsOn","closed","reportedOn","eligible","declaration","certificateThrough","exempt","exemptionBasis","basis"],"additionalProperties":false},"calendar":{"type":"object","properties":{"employeeVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"percent":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"preview":{"maxItems":366,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"hours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["date","hours"],"additionalProperties":false}}},"required":["employeeVersion","percent","preview"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"removeSickPeriod"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"vacationYear"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"percentageRule":{"type":"boolean"},"monthlyDayDeduction":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["amount","basis"],"additionalProperties":false},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"nonQualifyingDays":{"type":"integer","minimum":0,"maximum":366},"openingThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"wageBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"absenceWage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"paidTakenBefore":{"type":"integer","minimum":0,"maximum":50},"unpaidTakenBefore":{"type":"integer","minimum":0,"maximum":50},"saved":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"year":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"days":{"type":"integer","minimum":1,"maximum":50},"extension":{"type":"object","properties":{"agreedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["agreedOn","basis"],"additionalProperties":false}},"required":["year","days"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500},"liabilityDayValue":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"liabilityFeePercent":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"manual":{"type":"object","properties":{"paidDays":{"type":"integer","minimum":0,"maximum":50},"unpaidDays":{"type":"integer","minimum":0,"maximum":50},"dayPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"supplementPerDay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"vacationPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["paidDays","unpaidDays","dayPay","supplementPerDay","vacationPay"],"additionalProperties":false}},"required":["employeeId","startsOn","nonQualifyingDays","openingThrough","wageBasis","absenceWage","paidTakenBefore","unpaidTakenBefore","saved","basis","liabilityDayValue","liabilityFeePercent"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"previewVacationYearCorrection"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"correction":{"type":"object","properties":{"body":{"type":"object","properties":{"percentageRule":{"type":"boolean"},"monthlyDayDeduction":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["amount","basis"],"additionalProperties":false},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"nonQualifyingDays":{"type":"integer","minimum":0,"maximum":366},"openingThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"wageBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"absenceWage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"paidTakenBefore":{"type":"integer","minimum":0,"maximum":50},"unpaidTakenBefore":{"type":"integer","minimum":0,"maximum":50},"saved":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"year":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"days":{"type":"integer","minimum":1,"maximum":50},"extension":{"type":"object","properties":{"agreedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["agreedOn","basis"],"additionalProperties":false}},"required":["year","days"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500},"liabilityDayValue":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"liabilityFeePercent":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"manual":{"type":"object","properties":{"paidDays":{"type":"integer","minimum":0,"maximum":50},"unpaidDays":{"type":"integer","minimum":0,"maximum":50},"dayPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"supplementPerDay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"vacationPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["paidDays","unpaidDays","dayPay","supplementPerDay","vacationPay"],"additionalProperties":false}},"required":["employeeId","startsOn","nonQualifyingDays","openingThrough","wageBasis","absenceWage","paidTakenBefore","unpaidTakenBefore","saved","basis","liabilityDayValue","liabilityFeePercent"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":1,"maxLength":500},"openingPaidVacationPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"correctionIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["body","through","reason","openingPaidVacationPay","correctionIds"],"additionalProperties":false}},"required":["kind","id","version","correction"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"correctVacationYear"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"correction":{"type":"object","properties":{"body":{"type":"object","properties":{"percentageRule":{"type":"boolean"},"monthlyDayDeduction":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["amount","basis"],"additionalProperties":false},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"nonQualifyingDays":{"type":"integer","minimum":0,"maximum":366},"openingThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"wageBasis":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"absenceWage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"paidTakenBefore":{"type":"integer","minimum":0,"maximum":50},"unpaidTakenBefore":{"type":"integer","minimum":0,"maximum":50},"saved":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"year":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"days":{"type":"integer","minimum":1,"maximum":50},"extension":{"type":"object","properties":{"agreedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["agreedOn","basis"],"additionalProperties":false}},"required":["year","days"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500},"liabilityDayValue":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"liabilityFeePercent":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"manual":{"type":"object","properties":{"paidDays":{"type":"integer","minimum":0,"maximum":50},"unpaidDays":{"type":"integer","minimum":0,"maximum":50},"dayPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"supplementPerDay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"vacationPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["paidDays","unpaidDays","dayPay","supplementPerDay","vacationPay"],"additionalProperties":false}},"required":["employeeId","startsOn","nonQualifyingDays","openingThrough","wageBasis","absenceWage","paidTakenBefore","unpaidTakenBefore","saved","basis","liabilityDayValue","liabilityFeePercent"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":1,"maxLength":500},"openingPaidVacationPay":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"correctionIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["body","through","reason","openingPaidVacationPay","correctionIds"],"additionalProperties":false},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean"}},"required":["kind","id","version","correction","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lockVacationYear"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean"}},"required":["kind","id","version","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"employee"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"number":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"name":{"type":"string","minLength":1,"maxLength":160},"birthDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"personalId":{"type":"string","pattern":"^(\\d{12}|)$"},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"recipientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"owner":{"type":"boolean"},"personnelType":{"type":"string","enum":["worker","salaried"]},"wageForm":{"type":"string","enum":["monthly","hourly"]},"wage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"employmentPercent":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"foraFok":{"type":"string","pattern":"^FOK\\d{6}$"},"foraFokFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"agreementId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"bankIban":{"type":"string","maxLength":34},"netDestination":{"type":"string","enum":["payable","bank","owner"]},"tax":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","const":"table"},"year":{"type":"integer","minimum":2026,"maximum":2099},"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"table":{"type":"integer","minimum":29,"maximum":42},"column":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":6}]}},"required":["method","year","effectiveFrom","table","column"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","const":"percentage"},"year":{"type":"integer","minimum":2026,"maximum":2099},"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"percentage":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":160},"source":{"type":"string","enum":["decision","secondary","other"]}},"required":["method","year","effectiveFrom","percentage","basis"],"additionalProperties":false}]}},"calendarThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"active":{"type":"boolean"},"workPattern":{"type":"object","properties":{"validFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"validThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"week":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"exceptions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"hours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["date","hours"],"additionalProperties":false}},"basis":{"type":"string","minLength":1,"maxLength":500},"statutorySick":{"type":"boolean"},"samePayEligible":{"type":"boolean"},"historyFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"priorKarens":{"maxItems":100,"type":"array","items":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"historyConfirmed":{"type":"boolean"}},"required":["validFrom","validThrough","week","basis","statutorySick","samePayEligible","historyFrom","priorKarens","historyConfirmed"],"additionalProperties":false},"garnishments":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":"string","minLength":1,"maxLength":500},"receivedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"protectedAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"maximum":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},{"type":"null"}]},"bankgiro":{"type":"string","pattern":"^\\d{7,8}$"},"period":{"type":"string","const":"month"},"account":{"type":"string","pattern":"^\\d{4}$"},"basis":{"type":"string","minLength":1,"maxLength":500},"active":{"type":"boolean"}},"required":["id","reference","receivedOn","from","through","protectedAmount","maximum","bankgiro","period","account","basis","active"],"additionalProperties":false}},"pensionRecipient":{"type":"boolean"},"smallAnnualPay":{"type":"object","properties":{"year":{"type":"integer","minimum":2026,"maximum":2099},"basis":{"type":"string","minLength":1,"maxLength":160}},"required":["year","basis"],"additionalProperties":false},"vaxa":{"type":"object","properties":{"position":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["position","basis"],"additionalProperties":false}},"required":["number","name","birthDate","personalId","email","recipientId","owner","personnelType","wageForm","wage","employmentPercent","startsOn","endsOn","agreementId","bankIban","netDestination","tax","calendarThrough","active"],"additionalProperties":false},"bankConfirmed":{"type":"boolean"}},"required":["kind","id","version","body","bankConfirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agreement"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"source":{"type":"string","minLength":1,"maxLength":160},"validFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"validThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"vacationRule":{"type":"string","enum":["same_pay","percentage"]},"vacationDays":{"type":"integer","minimum":25,"maximum":50},"vacationYearStart":{"type":"string","pattern":"^(04-01|01-01)$"},"earningYear":{"type":"string","enum":["previous","current"]},"weeklyDays":{"type":"integer","minimum":1,"maximum":5},"note":{"type":"string","maxLength":1000},"calculationProfile":{"type":"string","enum":["statutory_2026","manual"]}},"required":["name","source","validFrom","validThrough","vacationRule","vacationDays","vacationYearStart","earningYear","weeklyDays","note"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"companyBankId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"companyBankVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"periodPolicies":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"mode":{"type":"string","enum":["current","previous","hourly"]},"absenceMode":{"type":"string","enum":["previous","current","cutoff"]},"cutoffDay":{"type":"integer","minimum":1,"maximum":28},"payDay":{"type":"integer","minimum":1,"maximum":31},"bankDayAdjustment":{"type":"string","enum":["none","previous"]}},"required":["effectiveFrom","mode","absenceMode","cutoffDay","payDay","bankDayAdjustment"],"additionalProperties":false}},"payslipOrder":{"type":"string","enum":["type","date"]},"salaryBanks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":500},"iban":{"type":"string","maxLength":34},"active":{"type":"boolean"}},"required":["id","name","iban","active"],"additionalProperties":false}},"employerId":{"type":"string","pattern":"^(\\d{12}|)$"},"payDay":{"type":"integer","minimum":1,"maximum":28},"salaryBankName":{"type":"string","maxLength":100},"salaryBankIban":{"type":"string","maxLength":34},"salaryAccount":{"type":"string","pattern":"^\\d{4}$"},"hourlyAccount":{"type":"string","pattern":"^\\d{4}$"},"taxAccount":{"type":"string","pattern":"^\\d{4}$"},"feeExpenseAccount":{"type":"string","pattern":"^\\d{4}$"},"feePayableAccount":{"type":"string","pattern":"^\\d{4}$"},"netPayableAccount":{"type":"string","pattern":"^\\d{4}$"},"bankAccount":{"type":"string","pattern":"^\\d{4}$"},"ownerAccount":{"type":"string","pattern":"^\\d{4}$"},"benefitExpenseAccount":{"type":"string","pattern":"^\\d{4}$"},"benefitOffsetAccount":{"type":"string","pattern":"^\\d{4}$"},"deductionAccount":{"type":"string","pattern":"^\\d{4}$"},"contactName":{"type":"string","maxLength":100},"contactEmail":{"anyOf":[{"type":"string","maxLength":200,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"contactPhone":{"type":"string","maxLength":40},"workplaceStreet":{"type":"string","maxLength":50},"workplaceCity":{"type":"string","maxLength":50}},"required":["employerId","payDay","salaryBankName","salaryBankIban","salaryAccount","hourlyAccount","taxAccount","feeExpenseAccount","feePayableAccount","netPayableAccount","bankAccount","ownerAccount","benefitExpenseAccount","benefitOffsetAccount","deductionAccount","contactName","contactEmail","contactPhone","workplaceStreet","workplaceCity"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"calendar"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"category":{"type":"string","enum":["sick","vab","parental","vacation","other"]},"hours":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"note":{"type":"string","maxLength":300},"vacationKind":{"type":"string","enum":["paid","saved","unpaid"]},"savedYear":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["employeeId","date","category","hours","note"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"removeCalendar"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"calendarReviewed"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","id","version","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saveRun"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"absenceFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"absenceThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"scheduledPayMonth":{"type":"string","pattern":"^2026-(0[1-9]|1[0-2])$"},"periodMode":{"type":"string","enum":["current","previous","hourly"]},"periodDefaults":{"type":"object","properties":{"policy":{"type":"object","properties":{"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"mode":{"type":"string","enum":["current","previous","hourly"]},"absenceMode":{"type":"string","enum":["previous","current","cutoff"]},"cutoffDay":{"type":"integer","minimum":1,"maximum":28},"payDay":{"type":"integer","minimum":1,"maximum":31},"bankDayAdjustment":{"type":"string","enum":["none","previous"]}},"required":["effectiveFrom","mode","absenceMode","cutoffDay","payDay","bankDayAdjustment"],"additionalProperties":false},"settingsVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"bankCalendarVersion":{"type":"string","maxLength":60}},"required":["policy","settingsVersion","bankCalendarVersion"],"additionalProperties":false},"salaryBankId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"period":{"type":"string","pattern":"^2026-(0[1-9]|1[0-2])$"},"workFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"workThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"payDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"bookingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"taxReview":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":160}},"required":["amount","basis"],"additionalProperties":false},"items":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"wageTypeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"unitAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"ownPayment":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["id","wageTypeId","date","quantity","unitAmount","basis"],"additionalProperties":false}},"correctionIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"finalPay":{"type":"object","properties":{"accrualId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"lastRegularPayDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"regularGross":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["accrualId","endsOn","lastRegularPayDate","regularGross","basis"],"additionalProperties":false},"partialSalary":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":160}},"required":["amount","basis"],"additionalProperties":false},"settlement":{"type":"object","properties":{"lastRegularPayDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":1,"maxLength":160}},"required":["lastRegularPayDate","basis"],"additionalProperties":false},"manual":{"type":"object","properties":{"basis":{"type":"string","minLength":1,"maxLength":500},"confirmed":{"type":"boolean"},"tax":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":500}},"required":["amount","basis"],"additionalProperties":false},"rows":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["salary_addition","salary_deduction","vacation_pay","vacation_deduction","sick_pay","sick_deduction","karens","other_absence"]},"label":{"type":"string","minLength":1,"maxLength":100},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"unitAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"}},"required":["kind","label","quantity","unitAmount"],"additionalProperties":false}}},"required":["basis","confirmed","rows"],"additionalProperties":false},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"extraGross":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"benefit":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"netDeduction":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"comment":{"type":"string","maxLength":200},"payMode":{"type":"string","enum":["salary","net"]},"targetNet":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"netBasis":{"type":"string","maxLength":200},"oneOff":{"type":"object","properties":{"category":{"type":"string","enum":["bonus","retroactive","vacation","severance","final"]},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"annualIncome":{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},"basis":{"type":"string","minLength":1,"maxLength":160},"overridePercent":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,7})(\\.\\d{1,2})?$"},{"type":"null"}]},"overrideBasis":{"type":"string","maxLength":200}},"required":["category","amount","annualIncome","basis","overridePercent","overrideBasis"],"additionalProperties":false}},"required":["employeeId","quantity","extraGross","benefit","netDeduction","comment"],"additionalProperties":false}}},"required":["name","period","workFrom","workThrough","payDate","bookingDate","lines"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"release"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"acknowledged":{"maxItems":300,"type":"array","items":{"type":"string"}}},"required":["kind","id","version","reviewHash","acknowledged"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancel"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paymentList"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paid"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","id","version","date","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"post"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalExportReviewed":{"default":false,"type":"boolean"}},"required":["kind","id","version","fiscalYearId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"accountingExport"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","fiscalYearId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agi"},"period":{"type":"string","pattern":"^2026-(0[1-9]|1[0-2])$"},"regionalSupport":{"type":"object","properties":{"basis":{"type":"string","pattern":"^(0|[1-9]\\d{0,11})$"},"otherOperatingAid":{"type":"string","pattern":"^(0|[1-9]\\d{0,11})$"},"eligibilityConfirmed":{"type":"boolean"},"researchPriorityConfirmed":{"type":"boolean"}},"required":["basis","otherOperatingAid","eligibilityConfirmed","researchPriorityConfirmed"],"additionalProperties":false}},"required":["kind","period"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agiSubmitted"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","id","date","reference"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/tax-account":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTaxAccount","description":"Skattekonto via granskad filimport. bank.read och ledger.read krävs; ändringar kräver bank.write och ledger.write. Ingen extern direktanslutning.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnTaxAccount","description":"Skattekonto via granskad filimport. bank.read och ledger.read krävs; ändringar kräver bank.write och ledger.write. Ingen extern direktanslutning.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"book"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"counterAccount":{"type":"string","pattern":"^\\d{4}$"},"duplicateReviewed":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","counterAccount","duplicateReviewed","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ignore"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","id","version","journalId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reopen"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","id","version","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/periodizations":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getPeriodizations","description":"Granskade planer för bokförda kostnader och intäkter, H-verifikat och spårbart stopp. Momsdatum ändras inte. Människa med ledger.read respektive ledger.write krävs.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"workspace","in":"query","schema":{"type":"string","enum":["1"]}},{"name":"tab","in":"query","required":false,"schema":{"default":"work","type":"string","enum":["work","plans"]}},{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"search","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","ready","blocked","upcoming","active","completed","stopped"]}},{"name":"account","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":30}},{"name":"periodFrom","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"periodTo","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":1000000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"selectedPlanId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"showFuture","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"fiscalYearId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"invoiceId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"sourceJournalId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"sourceJournal","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"invoiceSummary","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"linksJournal","in":"query","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"actOnPeriodizations","description":"Granskade planer för bokförda kostnader och intäkter, H-verifikat och spårbart stopp. Momsdatum ändras inte. Människa med ledger.read respektive ledger.write krävs.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"body":{"type":"object","properties":{"sourceJournalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourcePosition":{"type":"integer","minimum":1,"maximum":100},"sourceAllocationKey":{"type":"string","minLength":1,"maxLength":80},"allocatedAmount":{"type":"string","pattern":"^\\d{1,13}(?:\\.\\d{1,2})?$"},"balanceAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":120},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["sourceJournalId","sourcePosition","balanceAccount","firstMonth","months","reason"],"additionalProperties":false},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","body","reviewHash"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"book"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","id","version","through"],"additionalProperties":false},{"type":"object","properties":{"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"selections":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"positions":{"minItems":1,"maxItems":120,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":120}}},"required":["id","version","positions"],"additionalProperties":false}},"kind":{"type":"string","const":"batchBook"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["through","selections","kind","reviewHash"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"stop"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":3,"maxLength":1000},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","id","version","date","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/members":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getMembers","description":"Mänsklig användare ser sina egna rättigheter. Byråadministratör med commerce.configure kan se bolagets användare och ändra tre bokföringsbehörigheter för befintliga företagsanvändare. Bokföringsrättigheter för den egna användaren och byråroller ändras inte. Lönebehörighet tilldelas separat till befintliga mänskliga användare. Andra bolag och tjänsteidentiteter kan inte ändras.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnMembers","description":"Mänsklig användare ser sina egna rättigheter. Byråadministratör med commerce.configure kan se bolagets användare och ändra tre bokföringsbehörigheter för befintliga företagsanvändare. Bokföringsrättigheter för den egna användaren och byråroller ändras inte. Lönebehörighet tilldelas separat till befintliga mänskliga användare. Andra bolag och tjänsteidentiteter kan inte ändras.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"permissions"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedPermissions":{"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"permissions":{"maxItems":6,"type":"array","items":{"type":"string","enum":["company.name.write","invoice.write","ledger.write","invoice.post","receipts.write","ledger.export"]}}},"required":["kind","id","expectedPermissions","permissions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"access"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedPermissions":{"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"permissions":{"maxItems":51,"type":"array","items":{"type":"string","enum":["ledger.read","documents.read","invoice.read","bank.read","payroll.read","questions.answer","module.overview","module.work","module.customer_invoices","module.supplier_invoices","module.receipts","module.ledger","module.bank","module.cash","module.reconciliations","module.periodizations","module.assets","module.payroll","module.payslips","module.reports","module.vat","module.annual_closing","module.calendar","module.registers","module.documents","module.questions","module.messages","module.transfer","module.support","module.settings","bank.write","reconcile.write","payments.record","payments.prepare","payments.approve","payroll.write","payroll.export","inbox.senders.manage","documents.upload","auditor.manage","invoice.write","invoice.approve","invoice.post","ledger.write","receipts.read_all","receipts.review","receipts.write","ledger.export","company.archive.export","company.name.write","company.tax_profile.write"]}}},"required":["kind","id","expectedPermissions","permissions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"payrollPermissions"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedPermissions":{"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"permissions":{"maxItems":3,"type":"array","items":{"type":"string","enum":["payroll.read","payroll.write","payroll.export"]}}},"required":["kind","id","expectedPermissions","permissions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"remove"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedPermissions":{"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["kind","id","expectedPermissions"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getInvoices","description":"Register, utkast, fakturor, krediter, attest, betalning och årsslut. saveInvoice med post=true sparar och bokför atomiskt med samma åtgärdsnyckel; invoice.write, invoice.post och ledger.write krävs.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"workspace","in":"query","schema":{"type":"string","enum":["1"]},"description":"Sidindelad arbetsvy. Kräver kind. selected hämtar vald faktura och dess relationer."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["customer","supplier"]}},{"name":"fiscalYearId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["open","history","all"]}},{"name":"ids","in":"query","required":false,"schema":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"documentType","in":"query","required":false,"schema":{"type":"string","enum":["invoice","credit"]}},{"name":"registerPage","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000}},{"name":"registerSearch","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"registerState","in":"query","required":false,"schema":{"type":"string","enum":["all","active","inactive"]}},{"name":"registerSelected","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"registerSort","in":"query","required":false,"schema":{"type":"string","enum":["name","code","state"]}},{"name":"registerDirection","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"filter","in":"query","required":false,"schema":{"default":"handle","type":"string","enum":["handle","all","pending","unapproved","draft","deliver","failed","unpaid","overdue","in_progress","paid","void"]}},{"name":"tab","in":"query","required":false,"schema":{"default":"invoices","type":"string","enum":["invoices","payments","incoming","intake","customer","supplier","article"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":1000000}},{"name":"pageSize","in":"query","required":false,"schema":{"anyOf":[{"type":"number","const":50},{"type":"number","const":100},{"type":"number","const":200}]}},{"name":"sortBy","in":"query","required":false,"schema":{"default":"date","type":"string","enum":["invoice","party","date","dueDate","amount","open","accounting","approval","payment"]}},{"name":"sortDirection","in":"query","required":false,"schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"selected","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"query","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"party","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"from","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"dueFrom","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"dueTo","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"min","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":24}},{"name":"max","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":24}},{"name":"currency","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":10}},{"name":"paymentRoute","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","file","other"]}},{"name":"paymentIssue","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","approval","draft","reserved","recipient"]}},{"name":"account","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"content","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"delivery","in":"query","required":false,"schema":{"default":"","type":"string","enum":["","unsent","needs"]}},{"name":"approver","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"state","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","active","inactive"]}},{"name":"sort","in":"query","required":false,"schema":{"default":"name","type":"string","enum":["name","code","state"]}},{"name":"direction","in":"query","required":false,"schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"name":"exclude","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationNumber","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":100}},{"name":"vatNumber","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":100}},{"name":"email","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"view","in":"query","schema":{"type":"string","enum":["register","duplicates"]},"description":"register: smalt sidindelat register, tab=customer/supplier/article. duplicates: möjliga dubbletter i samma tillåtna motpartsregister."}]},"post":{"operationId":"actOnInvoices","description":"Register, utkast, fakturor, krediter, attest, betalning och årsslut. saveInvoice med post=true sparar och bokför atomiskt med samma åtgärdsnyckel; invoice.write, invoice.post och ledger.write krävs.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"splitProposal"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"pages":{"type":"string","minLength":3,"maxLength":200}},"required":["kind","id","version","pages"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"dismissProposal"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paymentFilePolicy"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"partyVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"mode":{"type":"string","enum":["supplier","disabled","enabled"]},"reason":{"type":"string","minLength":3,"maxLength":500},"overrideConfirmed":{"default":false,"type":"boolean"}},"required":["kind","invoiceId","version","partyVersion","mode","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"party"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"partyKind":{"type":"string","enum":["customer","supplier"]},"code":{"type":"string","maxLength":30},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"defaultAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":140},"organizationNumber":{"default":"","type":"string","maxLength":30},"vatNumber":{"default":"","type":"string","maxLength":30},"address":{"default":{"street":"","postalCode":"","city":"","country":"SE"},"type":"object","properties":{"street":{"default":"","type":"string","maxLength":140},"postalCode":{"default":"","type":"string","maxLength":20},"city":{"default":"","type":"string","maxLength":70},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"email":{"default":"","anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"reminderEmail":{"default":"","anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"reminderText":{"default":"","type":"string","maxLength":2000},"reminderEmailText":{"default":"","type":"string","maxLength":2000},"phone":{"default":"","type":"string","maxLength":30},"active":{"default":true,"type":"boolean"},"language":{"default":"sv","type":"string","enum":["sv","en"]},"currency":{"default":"SEK","type":"string","pattern":"^[A-Z]{3}$"},"paymentDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"defaultAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"defaultVatRate":{"default":"25","type":"string","enum":["0","6","12","25"]},"taxTreatment":{"default":"domestic","type":"string","enum":["domestic","exempt","reverse"]},"deliveryChannel":{"default":"download","type":"string","enum":["download","email","kivra"]},"customerVatType":{"default":null,"anyOf":[{"type":"string","enum":["se","se_reverse","eu_reverse","eu_vat","export"]},{"type":"null"}]},"defaultSalesType":{"anyOf":[{"type":"string","enum":["goods","service"]},{"type":"null"}]},"customerDeliveryMethod":{"default":null,"anyOf":[{"type":"string","enum":["einvoice","email","print"]},{"type":"null"}]},"beneficiary":{"default":null,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["bankgiro","plusgiro","iban"]},"number":{"type":"string","maxLength":34},"bic":{"default":"","type":"string","maxLength":11},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"required":["type","number"],"additionalProperties":false},{"type":"null"}]},"beneficiaries":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":80},"active":{"default":true,"type":"boolean"},"isDefault":{"default":false,"type":"boolean"},"beneficiary":{"type":"object","properties":{"type":{"type":"string","enum":["bankgiro","plusgiro","iban"]},"number":{"type":"string","maxLength":34},"bic":{"default":"","type":"string","maxLength":11},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"required":["type","number"],"additionalProperties":false}},"required":["id","label","beneficiary"],"additionalProperties":false}},"paymentFileDisabled":{"type":"boolean"},"reference":{"default":"","type":"string","maxLength":100},"notes":{"default":"","type":"string","maxLength":1000},"reminderFeeAgreed":{"default":false,"type":"boolean"},"lateInterestAgreed":{"default":false,"type":"boolean"},"peppolId":{"default":"","type":"string","maxLength":80}},"required":["name","defaultAccount"],"additionalProperties":false}},"required":["kind","id","version","partyKind","code","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"article"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"code":{"type":"string","minLength":1,"maxLength":30},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"unit":{"default":"st","type":"string","minLength":1,"maxLength":15},"unitPrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,10})(\\.\\d{1,6})?$"},"vatRate":{"default":"25","type":"string","enum":["0","6","12","25"]},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"active":{"default":true,"type":"boolean"},"type":{"default":"service","type":"string","enum":["goods","service"]}},"required":["name","unitPrice","accountCode"],"additionalProperties":false}},"required":["kind","id","version","code","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"issuer":{"type":"object","properties":{"name":{"type":"string","maxLength":140},"organizationNumber":{"type":"string","maxLength":30},"vatNumber":{"type":"string","maxLength":30},"address":{"type":"object","properties":{"street":{"default":"","type":"string","maxLength":140},"postalCode":{"default":"","type":"string","maxLength":20},"city":{"default":"","type":"string","maxLength":70},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"phone":{"type":"string","maxLength":30},"fTax":{"type":"boolean"},"logoFileId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["name","organizationNumber","vatNumber","address","email","phone","fTax"],"additionalProperties":false},"accounts":{"type":"object","properties":{"bank":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"receivable":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"taxClaim":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"supplierCredit":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"inputVat":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"payable":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"outputVat":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"reverseOutputVat":{"default":"","anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"customerCredit":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"revenue":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"expense":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"fxGain":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"fxLoss":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"rounding":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"}},"required":["bank","receivable","taxClaim","supplierCredit","inputVat","payable","outputVat","customerCredit","revenue","expense","fxGain","fxLoss","rounding"],"additionalProperties":false},"beneficiary":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["bankgiro","plusgiro","iban"]},"number":{"type":"string","maxLength":34},"bic":{"default":"","type":"string","maxLength":11},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"required":["type","number"],"additionalProperties":false},{"type":"null"}]},"paymentDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"customerOcr":{"default":true,"type":"boolean"},"houseworkEnabled":{"default":false,"type":"boolean"},"houseworkDefault":{"default":"none","type":"string","enum":["none","rot","rut","green_solar","green_storage","green_charger"]},"approvalFlows":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"minimum":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","name","minimum","steps"],"additionalProperties":false}},"requireApproval":{"default":false,"type":"boolean"},"separatePaymentApprover":{"default":false,"type":"boolean"},"reminderDays":{"default":7,"type":"integer","minimum":1,"maximum":90},"dueWarningDays":{"default":3,"type":"integer","minimum":0,"maximum":30},"missingBankReplyDays":{"default":3,"type":"integer","minimum":1,"maximum":30},"reminderFee":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reminderText":{"default":"","type":"string","maxLength":2000},"reminderEmailText":{"default":"","type":"string","maxLength":2000},"annualInterest":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"interestValidFrom":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"interestValidThrough":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"periodizationThreshold":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"automaticBank":{"default":false,"type":"boolean"},"bankTolerance":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"uniqueMatchDays":{"default":3,"type":"integer","minimum":0,"maximum":30},"automaticQuestions":{"default":false,"type":"boolean"},"questionRecipientId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"questionAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"questionAgeDays":{"default":14,"type":"integer","minimum":1,"maximum":365},"currencies":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"rate":{"type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"source":{"type":"string","minLength":1,"maxLength":150}},"required":["currency","rate","date","source"],"additionalProperties":false}}},"required":["issuer","accounts","beneficiary"],"additionalProperties":false},"customerCounter":{"type":"string","pattern":"^[1-9]\\d{0,12}$"}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saveInvoice"},"post":{"type":"boolean"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"invoiceKind":{"type":"string","enum":["customer","supplier"]},"body":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"partyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"serviceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"supplierReference":{"default":"","type":"string","maxLength":80},"ocr":{"default":"","type":"string","maxLength":25},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"exchangeRate":{"default":"1","type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"rateDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"rateSource":{"default":"Manuellt","type":"string","minLength":1,"maxLength":150},"language":{"default":"sv","type":"string","enum":["sv","en"]},"reference":{"default":"","type":"string","maxLength":100},"ourReference":{"default":"","type":"string","maxLength":100},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"originalPosition":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":40},{"type":"null"}]},"articleId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":500},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})(\\.\\d{1,3})?$"},"unit":{"default":"st","type":"string","minLength":1,"maxLength":15},"unitPrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,10})(\\.\\d{1,6})?$"},"discount":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"vatRate":{"type":"string","enum":["0","6","12","25"]},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"taxTreatment":{"default":"domestic","type":"string","enum":["domestic","exempt","reverse"]},"taxNote":{"default":"","type":"string","maxLength":300},"deductible":{"default":"100","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"reverseCharge":{"type":"object","properties":{"purchase":{"type":"string","enum":["eu_service_25","outside_eu_service_25"]},"basis":{"default":"","type":"string","maxLength":500},"confirmed":{"default":false,"type":"boolean"}},"required":["purchase"],"additionalProperties":false},"salesVat":{"type":"object","properties":{"treatment":{"type":"string","enum":["eu_goods","eu_service","triangulation","export_goods","outside_service","domestic_reverse"]},"reportingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"},"vatCheck":{"type":"object","properties":{"checkId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"string","pattern":"^[A-Z]{2}[A-Z0-9]{2,12}$"},"checkedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":500},"valid":{"type":"boolean","const":true}},"required":["number","checkedOn","reference","valid"],"additionalProperties":false}},"required":["treatment","reportingDate"],"additionalProperties":false},"customerVatReview":{"type":"object","properties":{"profile":{"type":"string","const":"eu_vat"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"}},"required":["profile"],"additionalProperties":false},"work":{"default":null,"anyOf":[{"type":"object","properties":{"scheme":{"type":"string","enum":["rot","rut","green_solar","green_storage","green_charger"]},"category":{"type":"string","minLength":1,"maxLength":70},"hours":{"type":"integer","minimum":0,"maximum":999}},"required":["scheme","category","hours"],"additionalProperties":false},{"type":"null"}]},"costCenter":{"default":"","type":"string","maxLength":30},"project":{"default":"","type":"string","maxLength":30}},"required":["description","quantity","unitPrice","vatRate","accountCode"],"additionalProperties":false}},"text":{"default":"","type":"string","maxLength":2000},"beneficiary":{"default":null,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["bankgiro","plusgiro","iban"]},"number":{"type":"string","maxLength":34},"bic":{"default":"","type":"string","maxLength":11},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"required":["type","number"],"additionalProperties":false},{"type":"null"}]},"beneficiaryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"paymentDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"rounding":{"default":"none","type":"string","enum":["1","none"]},"advance":{"type":"object","properties":{"vatTiming":{"type":"string","enum":["payment","construction_invoice"]},"balanceAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"basis":{"type":"string","minLength":10,"maxLength":1000}},"required":["vatTiming","balanceAccount","basis"],"additionalProperties":false},"periodizationIntents":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"costCenter":{"default":"","type":"string","maxLength":30},"project":{"default":"","type":"string","maxLength":30},"linePosition":{"type":"integer","minimum":1,"maximum":40},"balanceAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":120},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["accountCode","balanceAccount","firstMonth","months","reason"],"additionalProperties":false}},"houseworkCredit":{"type":"object","properties":{"taxAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"noticeReference":{"type":"string","minLength":3,"maxLength":300},"confirmed":{"type":"boolean","const":true},"sourceHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"cases":{"maxItems":10000,"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"claimAmountSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["caseId","requestId","decisionId","amount"],"additionalProperties":false}},"unclaimedTax":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["taxAmount","noticeReference","confirmed","sourceHash","cases","unclaimedTax"],"additionalProperties":false},"openingCreditReview":{"type":"object","properties":{"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"basis":{"type":"string","minLength":10,"maxLength":1500},"linesHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reviewed":{"type":"boolean","const":true}},"required":["fileId","basis","linesHash","reviewed"],"additionalProperties":false},"housework":{"default":null,"anyOf":[{"type":"object","properties":{"scheme":{"type":"string","enum":["rot","rut","green_solar","green_storage","green_charger"]},"completedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"fixedPrice":{"type":"object","properties":{"allInclusive":{"type":"boolean","const":true},"basis":{"type":"string","minLength":10,"maxLength":1000}},"required":["allInclusive","basis"],"additionalProperties":false},"buyers":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"personalNumber":{"type":"string","pattern":"^\\d{12}$"},"share":{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"property":{"default":"","type":"string","maxLength":100},"associationNumber":{"default":"","type":"string","maxLength":12},"apartment":{"default":"","type":"string","maxLength":30}},"required":["name","personalNumber","share"],"additionalProperties":false}}},"required":["scheme","completedOn","buyers"],"additionalProperties":false},{"type":"null"}]}},"required":["fiscalYearId","partyId","invoiceDate","dueDate","serviceDate","currency","rateDate","lines"],"additionalProperties":false},"duplicateReason":{"default":"","type":"string","maxLength":1000},"updatePartyDefaults":{"default":false,"type":"boolean"},"intakeProposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","invoiceKind","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"issueInvoice"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"duplicateReason":{"default":"","type":"string","maxLength":1000},"advanceIds":{"default":[],"maxItems":40,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"advanceEvidence":{"default":"","type":"string","maxLength":1000}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"completeAdvance"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"evidence":{"type":"string","minLength":10,"maxLength":1000},"lines":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":40},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})(\\.\\d{1,3})?$"}},"required":["position","quantity"],"additionalProperties":false}}},"required":["kind","id","version","date","evidence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancelAdvance"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":10,"maxLength":1000},"refund":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"reference":{"type":"string","minLength":1,"maxLength":200},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["accountCode","reference"],"additionalProperties":false}},"required":["kind","id","version","date","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"creditAdvance"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":10,"maxLength":1000},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":40},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})(\\.\\d{1,3})?$"}},"required":["position","quantity"],"additionalProperties":false}},"refund":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"reference":{"type":"string","minLength":1,"maxLength":200},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["accountCode","reference"],"additionalProperties":false}},"required":["kind","id","version","date","reason","lines"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"voidInvoice"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submitApproval"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"flowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"duplicateReason":{"default":"","type":"string","maxLength":1000}},"required":["kind","id","version","flowId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"decideApproval"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"approve":{"type":"boolean"},"comment":{"type":"string","maxLength":1000},"duplicateReason":{"default":"","type":"string","maxLength":1000}},"required":["kind","id","version","approve","comment"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"openingCredit"},"originalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":10,"maxLength":1000},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewed":{"type":"boolean","const":true},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"originalPosition":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":40},{"type":"null"}]},"articleId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":500},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})(\\.\\d{1,3})?$"},"unit":{"default":"st","type":"string","minLength":1,"maxLength":15},"unitPrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,10})(\\.\\d{1,6})?$"},"discount":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"vatRate":{"type":"string","enum":["0","6","12","25"]},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"taxTreatment":{"default":"domestic","type":"string","enum":["domestic","exempt","reverse"]},"taxNote":{"default":"","type":"string","maxLength":300},"deductible":{"default":"100","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"reverseCharge":{"type":"object","properties":{"purchase":{"type":"string","enum":["eu_service_25","outside_eu_service_25"]},"basis":{"default":"","type":"string","maxLength":500},"confirmed":{"default":false,"type":"boolean"}},"required":["purchase"],"additionalProperties":false},"salesVat":{"type":"object","properties":{"treatment":{"type":"string","enum":["eu_goods","eu_service","triangulation","export_goods","outside_service","domestic_reverse"]},"reportingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"},"vatCheck":{"type":"object","properties":{"checkId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"string","pattern":"^[A-Z]{2}[A-Z0-9]{2,12}$"},"checkedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":500},"valid":{"type":"boolean","const":true}},"required":["number","checkedOn","reference","valid"],"additionalProperties":false}},"required":["treatment","reportingDate"],"additionalProperties":false},"customerVatReview":{"type":"object","properties":{"profile":{"type":"string","const":"eu_vat"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"}},"required":["profile"],"additionalProperties":false},"work":{"default":null,"anyOf":[{"type":"object","properties":{"scheme":{"type":"string","enum":["rot","rut","green_solar","green_storage","green_charger"]},"category":{"type":"string","minLength":1,"maxLength":70},"hours":{"type":"integer","minimum":0,"maximum":999}},"required":["scheme","category","hours"],"additionalProperties":false},{"type":"null"}]},"costCenter":{"default":"","type":"string","maxLength":30},"project":{"default":"","type":"string","maxLength":30}},"required":["description","quantity","unitPrice","vatRate","accountCode"],"additionalProperties":false}}},"required":["kind","originalId","date","reason","fileId","reviewed","lines"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"credit"},"supplierReference":{"type":"string","maxLength":80},"originalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"houseworkReview":{"type":"object","properties":{"taxAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"noticeReference":{"type":"string","minLength":3,"maxLength":300},"confirmed":{"type":"boolean","const":true}},"required":["taxAmount","noticeReference","confirmed"],"additionalProperties":false},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":1,"maxLength":1000},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":40},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})(\\.\\d{1,3})?$"}},"required":["position","quantity"],"additionalProperties":false}}},"required":["kind","originalId","date","reason","lines"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"recordPayments"},"invoiceKind":{"type":"string","enum":["customer","supplier"]},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"rows":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedOpen":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reference":{"type":"string","minLength":1,"maxLength":200},"electronic":{"default":true,"type":"boolean"},"houseworkSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkRateSource":{"type":"string","minLength":3,"maxLength":150},"chargePayments":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"chargeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["chargeId","amount"],"additionalProperties":false}}},"required":["invoiceId","date","amount","actualSEK","reference"],"additionalProperties":false}}},"required":["kind","invoiceKind","accountCode","rows"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"payment"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkRateSource":{"type":"string","minLength":3,"maxLength":150},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"reference":{"type":"string","minLength":1,"maxLength":200},"payer":{"default":"party","type":"string","enum":["party","tax"]},"electronic":{"default":true,"type":"boolean"},"chargePayments":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"chargeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["chargeId","amount"],"additionalProperties":false}}},"required":["kind","id","date","amount","actualSEK","accountCode","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"offset"},"payer":{"default":"party","type":"string","enum":["party","tax"]},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"creditId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["kind","invoiceId","creditId","date","amount","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reversePayment"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"settlementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["kind","id","settlementId","date","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"yearEnd"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","fiscalYearId"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/bank":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getBank","description":"Bankavtal, betaluppdrag, bankfiler och återrapportering. Filkvittens bokför ingen bankbetalning.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnBank","description":"Bankavtal, betaluppdrag, bankfiler och återrapportering. Filkvittens bokför ingen bankbetalning.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"account"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"profile":{"type":"string","enum":["seb","handelsbanken","swedbank","nordea"]},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"iban":{"type":"string","maxLength":34},"customerId":{"type":"string","minLength":1,"maxLength":35},"debtorId":{"default":"","type":"string","maxLength":35},"senderGiro":{"default":"","type":"string","maxLength":15},"active":{"default":true,"type":"boolean"}},"required":["name","profile","accountCode","iban","customerId"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"verifyBeneficiary"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"registered":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["bankgiro","plusgiro","iban"]},"number":{"type":"string","maxLength":34},"bic":{"default":"","type":"string","maxLength":11},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"required":["type","number"],"additionalProperties":false},{"type":"null"}]},"proposed":{"type":"object","properties":{"type":{"type":"string","enum":["bankgiro","plusgiro","iban"]},"number":{"type":"string","maxLength":34},"bic":{"default":"","type":"string","maxLength":11},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"required":["type","number"],"additionalProperties":false},"proof":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","invoiceId","registered","proposed","proof"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"prepare"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"credits":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["invoiceId","amount"],"additionalProperties":false}}},"required":["invoiceId","amount"],"additionalProperties":false}}},"required":["kind","accountId","date","items"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"approve"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"uploaded"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","date","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"recall"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"confirmRecall"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"reference":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"feedback"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fileName":{"type":"string","minLength":1,"maxLength":180},"xml":{"type":"string","maxLength":52428800}},"required":["kind","id","fileName","xml"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 105906176 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/bank-transactions":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getBankTransactions","description":"Bankrader, fördelningar och matchningar. Faktura, avgift, ränta och faktisk återbetalning kan fördelas på samma rad.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"query","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"accountId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"from","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"filter","in":"query","required":false,"schema":{"default":"open","type":"string","enum":["all","open","waiting","matched","ignored","duplicate","unhandled"]}},{"name":"direction","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","in","out"]}},{"name":"attachment","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","yes","no"]}},{"name":"suggestion","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","unique","multiple","none"]}},{"name":"sort","in":"query","required":false,"schema":{"default":"oldest","type":"string","enum":["oldest","newest","amount"]}},{"name":"importId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"row","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":1000000}},{"name":"tab","in":"query","required":false,"schema":{"default":"rows","type":"string","enum":["rows","history","rules","import","connections"]}},{"name":"mode","in":"query","schema":{"type":"string","enum":["invoices","journals","transfers"]}},{"name":"ids","in":"query","schema":{"type":"string"},"description":"Valda faktura-ID, kommaseparerade."}]},"post":{"operationId":"actOnBankTransactions","description":"Granska med mode=preview och spara action tillsammans med reviewHash. Bankrader, full kontering och fakturarester kontrolleras på nytt. Batch har eget åtgärds-ID per rad; resultat och fel redovisas per rad.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","format":"uuid"},"description":"Obligatorisk vid sparning. Granskning skapar ingen beständig bokföring."},{"name":"mode","in":"query","schema":{"type":"string","enum":["preview","batch-preview"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"transfer"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"otherId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"otherVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"type":"string","minLength":3,"maxLength":200}},"required":["kind","id","version","otherId","otherVersion","description"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchJournals"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"rows":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"allocations":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"rowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"}},"required":["rowId","journalId","amountSEK"],"additionalProperties":false}},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","rows","allocations","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reverseMatches"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"groupId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","groupId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"distinct":{"type":"boolean"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","distinct","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ignore"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reopen"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchInvoices"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allocations":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkRateSource":{"type":"string","minLength":3,"maxLength":150},"payer":{"default":"party","type":"string","enum":["party","tax"]},"rounding":{"default":false,"type":"boolean"}},"required":["invoiceId","amount","actualSEK"],"additionalProperties":false}},"charges":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"chargeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"refundOf":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["chargeId","amount","actualSEK"],"additionalProperties":false}},"adjustments":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},"description":{"type":"string","minLength":1,"maxLength":200}},"required":["accountCode","amountSEK","description"],"additionalProperties":false}}},"required":["kind","id","version","allocations"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchOrder"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"orderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"adjustments":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},"description":{"type":"string","minLength":1,"maxLength":200}},"required":["accountCode","amountSEK","description"],"additionalProperties":false}}},"required":["kind","id","version","orderId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchJournal"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","journalId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"book"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"type":"string","minLength":1,"maxLength":200},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"debit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"credit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"info":{"default":"","type":"string","maxLength":200}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["kind","id","version","description","lines"],"additionalProperties":false}]},{"type":"object","properties":{"action":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"transfer"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"otherId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"otherVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"type":"string","minLength":3,"maxLength":200}},"required":["kind","id","version","otherId","otherVersion","description"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchJournals"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"rows":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"allocations":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"rowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"}},"required":["rowId","journalId","amountSEK"],"additionalProperties":false}},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","rows","allocations","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reverseMatches"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"groupId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","groupId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"distinct":{"type":"boolean"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","distinct","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ignore"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reopen"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchInvoices"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allocations":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkRateSource":{"type":"string","minLength":3,"maxLength":150},"payer":{"default":"party","type":"string","enum":["party","tax"]},"rounding":{"default":false,"type":"boolean"}},"required":["invoiceId","amount","actualSEK"],"additionalProperties":false}},"charges":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"chargeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"refundOf":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["chargeId","amount","actualSEK"],"additionalProperties":false}},"adjustments":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},"description":{"type":"string","minLength":1,"maxLength":200}},"required":["accountCode","amountSEK","description"],"additionalProperties":false}}},"required":["kind","id","version","allocations"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchOrder"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"orderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"adjustments":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},"description":{"type":"string","minLength":1,"maxLength":200}},"required":["accountCode","amountSEK","description"],"additionalProperties":false}}},"required":["kind","id","version","orderId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchJournal"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","journalId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"book"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"type":"string","minLength":1,"maxLength":200},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"debit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"credit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"info":{"default":"","type":"string","maxLength":200}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["kind","id","version","description","lines"],"additionalProperties":false}]},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["action","reviewHash"],"additionalProperties":false},{"type":"object","properties":{"batch":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"action":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"transfer"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"otherId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"otherVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"type":"string","minLength":3,"maxLength":200}},"required":["kind","id","version","otherId","otherVersion","description"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchJournals"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"rows":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"allocations":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"rowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"}},"required":["rowId","journalId","amountSEK"],"additionalProperties":false}},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","rows","allocations","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reverseMatches"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"groupId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","groupId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"distinct":{"type":"boolean"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","distinct","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ignore"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reopen"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchInvoices"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allocations":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"houseworkRateSource":{"type":"string","minLength":3,"maxLength":150},"payer":{"default":"party","type":"string","enum":["party","tax"]},"rounding":{"default":false,"type":"boolean"}},"required":["invoiceId","amount","actualSEK"],"additionalProperties":false}},"charges":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"chargeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"refundOf":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["chargeId","amount","actualSEK"],"additionalProperties":false}},"adjustments":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},"description":{"type":"string","minLength":1,"maxLength":200}},"required":["accountCode","amountSEK","description"],"additionalProperties":false}}},"required":["kind","id","version","allocations"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchOrder"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"orderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"adjustments":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"amountSEK":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},"description":{"type":"string","minLength":1,"maxLength":200}},"required":["accountCode","amountSEK","description"],"additionalProperties":false}}},"required":["kind","id","version","orderId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"matchJournal"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","journalId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"book"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"type":"string","minLength":1,"maxLength":200},"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"debit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"credit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"info":{"default":"","type":"string","maxLength":200}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["kind","id","version","description","lines"],"additionalProperties":false}]},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"key":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["action","reviewHash","key"],"additionalProperties":false}}},"required":["batch"],"additionalProperties":false},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/bank-rules":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getBankRules","description":"Prioriterade regler, regelförslag, körningar och uttryckligt automatläge.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnBankRules","description":"Prioriterade regler, regelförslag, körningar och uttryckligt automatläge.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"package"},"package":{"type":"string","enum":["seb","handelsbanken","swedbank","nordea","tax"]},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"counterAccounts":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"}},"active":{"type":"boolean"}},"required":["kind","package","accountId","counterAccounts","active"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"save"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"active":{"type":"boolean"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"direction":{"type":"string","enum":["in","out"]},"text":{"type":"object","properties":{"value":{"type":"string","maxLength":160},"match":{"default":"contains","type":"string","enum":["contains","exact"]}},"required":["value"],"additionalProperties":false},"counterparty":{"type":"object","properties":{"value":{"type":"string","maxLength":160},"match":{"default":"contains","type":"string","enum":["contains","exact"]}},"required":["value"],"additionalProperties":false},"reference":{"type":"object","properties":{"value":{"type":"string","maxLength":160},"match":{"default":"contains","type":"string","enum":["contains","exact"]}},"required":["value"],"additionalProperties":false},"minimum":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"maximum":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"action":{"type":"string","enum":["book","ignore"]},"description":{"type":"string","minLength":1,"maxLength":200},"allocations":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"percentage":{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"}},"required":["accountCode","percentage"],"additionalProperties":false}}},"required":["name","active","accountId","direction","text","counterparty","reference","minimum","maximum","action","description","allocations"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reorder"},"rules":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}}},"required":["kind","rules"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"apply"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"rowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rowVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","ruleId","ruleVersion","rowId","rowVersion"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"automate"},"importId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"propose"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"decide"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"approve":{"type":"boolean"}},"required":["kind","id","version","approve"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 524288 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/reconciliations":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getReconciliations","description":"Kontoavstämningar med sparade historiska resultat.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"fiscalYearId","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string"}},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"account","in":"query","schema":{"type":"string"}},{"name":"id","in":"query","schema":{"type":"string"}}]},"post":{"operationId":"actOnReconciliations","description":"Kontoavstämningar med sparade historiska resultat.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"start"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accounts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"}},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","fiscalYearId","accounts","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reviewAgain"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"save"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"format":{"default":2,"type":"number","const":2},"externalBalance":{"anyOf":[{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},{"type":"null"}]},"source":{"default":{"kind":"manual","reference":"","asOf":"","documentVersionId":null,"bankImportId":null,"coverageFrom":null,"coverageTo":null,"confirmed":false},"type":"object","properties":{"kind":{"default":"manual","type":"string","enum":["manual","bank_import","receivables","payables","periodization","assets","payroll"]},"reference":{"default":"","type":"string","maxLength":1000},"asOf":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"documentVersionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"bankImportId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"coverageFrom":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"coverageTo":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"confirmed":{"default":false,"type":"boolean"}},"additionalProperties":false},"comment":{"default":"","type":"string","maxLength":2000},"checks":{"maxItems":10000,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^(journal|bank):[a-f0-9-]{36}$"},"checked":{"default":false,"type":"boolean"},"comment":{"default":"","type":"string","maxLength":2000},"classification":{"default":"unresolved","type":"string","enum":["unresolved","waiting","manual","timing"]},"reference":{"default":"","type":"string","maxLength":1000},"expectedDate":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"documentVersionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"questionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"evidenceHash":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]}},"required":["key"],"additionalProperties":false}}},"required":["checks"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"complete"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"format":{"default":2,"type":"number","const":2},"externalBalance":{"anyOf":[{"type":"string","pattern":"^-?(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"},{"type":"null"}]},"source":{"default":{"kind":"manual","reference":"","asOf":"","documentVersionId":null,"bankImportId":null,"coverageFrom":null,"coverageTo":null,"confirmed":false},"type":"object","properties":{"kind":{"default":"manual","type":"string","enum":["manual","bank_import","receivables","payables","periodization","assets","payroll"]},"reference":{"default":"","type":"string","maxLength":1000},"asOf":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"documentVersionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"bankImportId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"coverageFrom":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"coverageTo":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"confirmed":{"default":false,"type":"boolean"}},"additionalProperties":false},"comment":{"default":"","type":"string","maxLength":2000},"checks":{"maxItems":10000,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^(journal|bank):[a-f0-9-]{36}$"},"checked":{"default":false,"type":"boolean"},"comment":{"default":"","type":"string","maxLength":2000},"classification":{"default":"unresolved","type":"string","enum":["unresolved","waiting","manual","timing"]},"reference":{"default":"","type":"string","maxLength":1000},"expectedDate":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"documentVersionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"questionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"evidenceHash":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]}},"required":["key"],"additionalProperties":false}}},"required":["checks"],"additionalProperties":false},"fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"},"result":{"default":"auto","type":"string","enum":["approved","exceptions","auto"]}},"required":["kind","id","version","body","fingerprint"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 524288 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/questions":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getQuestions","description":"Privata kundfrågor och byråfrågor; endast trådens tillåtna mottagare ser innehållet.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"filter","in":"query","required":false,"schema":{"default":"handle","type":"string","enum":["active","handle","waiting","open","answered","closed","all"]}},{"name":"sourceType","in":"query","required":false,"schema":{"default":"","type":"string","enum":["","bank","journal","invoice","receipt"]}},{"name":"sourceId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"search","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"schema":{"default":"latest","type":"string","enum":["latest","waiting","due"]}},{"name":"handler","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":"unassigned"},{"type":"string","const":""}]}},{"name":"recipient","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"type","in":"query","required":false,"schema":{"default":"","type":"string","enum":["","bank","journal","invoice","receipt","period"]}},{"name":"from","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"activity","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"completion","in":"query","required":false,"schema":{"default":"","type":"string","enum":["","done","cancelled"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"question","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"mode","in":"query","schema":{"type":"string","enum":["page","source","sources","hunt","count","contexts","files"]}}]},"post":{"operationId":"actOnQuestions","description":"Privata kundfrågor och byråfrågor; endast trådens tillåtna mottagare ser innehållet.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"askAgency"},"source":{"type":"object","properties":{"kind":{"type":"string","enum":["bank","journal","invoice","receipt"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["kind","source","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ask"},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"source":{"type":"object","properties":{"kind":{"type":"string","enum":["bank","journal","invoice","receipt"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false},"recipientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["kind","source","recipientId","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"answer"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"text":{"type":"string","maxLength":4000},"next":{"default":"keep","type":"string","enum":["keep","customer","done"]},"internal":{"default":false,"type":"boolean"},"missing":{"default":false,"type":"boolean"},"references":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["document","receipt"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}}},"required":["kind","id","version","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"close"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["kind","id","version","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reopen"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["kind","id","version","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"remind"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"hunt"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"createHunt"},"sources":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["bank","journal","invoice","receipt"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"recipientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":3,"maxLength":2000},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","sources","recipientId","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"requestPeriod"},"source":{"type":"object","properties":{"kind":{"type":"string","const":"period"},"classification":{"default":"general","type":"string","const":"general"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"activityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","from","to"],"additionalProperties":false},"recipientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":3,"maxLength":2000},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","source","recipientId","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancel"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["kind","id","version","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"assign"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"handlerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","id","version","handlerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"preferences"},"body":{"type":"object","properties":{"questions":{"default":true,"type":"boolean"},"approvals":{"default":true,"type":"boolean"},"reminders":{"default":true,"type":"boolean"},"days":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":60},{"type":"null"}]}},"additionalProperties":false}},"required":["kind","body"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/deliveries":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getDeliveries","description":"Dokumentleverans och omförsök. Lokala mejl fångas; Kivra-anslutningen är ännu inte aktiverad.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"view","in":"query","required":false,"schema":{"default":"needs","type":"string","enum":["needs","ongoing","history","all"]}},{"name":"search","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"kind","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":60}},{"name":"channel","in":"query","required":false,"schema":{"default":"","type":"string","enum":["","email","kivra"]}},{"name":"status","in":"query","required":false,"schema":{"default":"","type":"string","enum":["","queued","prepared","sending","accepted","delivered","bounced","uncertain","captured","blocked","failed","cancelled"]}},{"name":"from","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"job","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"subject","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}}]},"post":{"operationId":"actOnDeliveries","description":"Dokumentleverans och omförsök. Lokala mejl fångas; Kivra-anslutningen är ännu inte aktiverad.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"invoice"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channel":{"type":"string","enum":["email","kivra"]},"to":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"subject":{"default":"","type":"string","maxLength":200,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"emailText":{"default":"","type":"string","maxLength":12000},"attachmentIds":{"default":[],"maxItems":19,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"reason":{"default":"","type":"string","maxLength":300},"previousId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","id","channel","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"retry"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"resolveUncertain"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"outcome":{"type":"string","enum":["sent","not_sent"]},"providerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]},"reason":{"type":"string","minLength":15,"maxLength":500}},"required":["kind","id","outcome","providerId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancel"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["kind","id","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/cash":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCash","description":"Dagskassa med underlag, betalningssätt, moms och dokumenterad dricks.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"parameters":[{"name":"fiscalYearId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"search","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":100}},{"name":"from","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"registerId","in":"query","required":false,"schema":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"state","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","draft","posted","void"]}},{"name":"sort","in":"query","required":false,"schema":{"default":"date_desc","type":"string","enum":["date_desc","date_asc","register"]}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":1000000}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"mode","in":"query","schema":{"type":"string","enum":["originals","settlementOptions"]}},{"name":"id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"selected","in":"query","schema":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20}}]},"post":{"operationId":"actOnCash","description":"Dagskassa med underlag, betalningssätt, moms och dokumenterad dricks.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"save"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"registerId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"registerVersion":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"register":{"type":"string","maxLength":80},"reference":{"type":"string","maxLength":80},"comment":{"default":"","type":"string","maxLength":1000},"rows":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["food","restaurant","alcohol","other"]},"description":{"type":"string","maxLength":100},"gross":{"type":"string","maxLength":40},"vatRate":{"type":"string","enum":["0","6","12","25"]},"vat":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"vatReason":{"default":"","type":"string","maxLength":500},"vatEvidence":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"reference":{"type":"string","maxLength":100},"gross":{"type":"string","maxLength":40},"vat":{"type":"string","maxLength":40}},"required":["reference","gross","vat"],"additionalProperties":false}},"accountCode":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"vatAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"originalDate":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"returnReference":{"default":"","type":"string","maxLength":200},"dimensions":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["kind","description","gross","vatRate","accountCode","vatAccount"],"additionalProperties":false}},"payments":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["cash","card","swish"]},"amount":{"type":"string","maxLength":40},"accountCode":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"settlement":{"type":"string","enum":["direct","clearing"]}},"required":["kind","amount","accountCode"],"additionalProperties":false}},"tips":{"type":"object","properties":{"amount":{"type":"string","maxLength":40},"mode":{"type":"string","enum":["","staff","employer","owner"]},"accountCode":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"voluntary":{"type":"boolean"},"comment":{"default":"","type":"string","maxLength":500}},"required":["amount","mode","accountCode","voluntary"],"additionalProperties":false},"receiptIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["fiscalYearId","date","register","reference","rows","payments","tips"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"preview"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"post"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","id","version","reviewHash"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"void"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"register"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"active":{"default":true,"type":"boolean"},"rows":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["food","restaurant","alcohol","other"]},"description":{"type":"string","maxLength":100},"vatRate":{"type":"string","enum":["0","6","12","25"]},"accountCode":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"vatAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"dimensions":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["kind","description","vatRate","accountCode","vatAccount"],"additionalProperties":false}},"payments":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["cash","card","swish"]},"accountCode":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"settlement":{"type":"string","enum":["direct","clearing"]}},"required":["kind","accountCode"],"additionalProperties":false}},"tips":{"default":{"mode":"","accountCode":"","voluntary":false,"comment":""},"type":"object","properties":{"mode":{"type":"string","enum":["","staff","employer","owner"]},"accountCode":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"voluntary":{"type":"boolean"},"comment":{"default":"","type":"string","maxLength":500}},"required":["mode","accountCode","voluntary"],"additionalProperties":false}},"required":["name","rows","payments"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"count"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"opening":{"type":"string","maxLength":40},"counted":{"type":"string","maxLength":40},"movements":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","maxLength":40},"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["journalId","amount","reason"],"additionalProperties":false}},"comment":{"default":"","type":"string","maxLength":1000}},"required":["opening","counted","movements"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settlementReversalPreview"},"settlementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","settlementId","date","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reverseSettlement"},"settlementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":5,"maxLength":500},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","settlementId","date","reason","reviewHash"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settlementPreview"},"body":{"type":"object","properties":{"bankRowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"bankVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allocations":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"reportId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["card","swish"]},"amount":{"type":"string","maxLength":40}},"required":["reportId","kind","amount"],"additionalProperties":false}},"fee":{"type":"string","maxLength":40},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"reference":{"type":"string","minLength":3,"maxLength":300},"receiptIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["bankRowId","bankVersion","allocations","fee","feeAccount","reference"],"additionalProperties":false}},"required":["kind","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settle"},"body":{"type":"object","properties":{"bankRowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"bankVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allocations":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"reportId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["card","swish"]},"amount":{"type":"string","maxLength":40}},"required":["reportId","kind","amount"],"additionalProperties":false}},"fee":{"type":"string","maxLength":40},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"reference":{"type":"string","minLength":3,"maxLength":300},"receiptIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["bankRowId","bankVersion","allocations","fee","feeAccount","reference"],"additionalProperties":false},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","body","reviewHash"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 524288 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/housework":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getHousework","description":"ROT, RUT och grön teknik: begäran, inlämning, beslut och betalarfördelning.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnHousework","description":"ROT, RUT och grön teknik: begäran, inlämning, beslut och betalarfördelning.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"refundBeforeClaim"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"creditId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"settlementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true}},"required":["kind","invoiceId","settlementId","date","amount","reason","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"prepare"},"name":{"type":"string","pattern":"^[\\p{L}\\p{N}]{1,16}$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"entries":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"paymentIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"costs":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["material","other"]},"category":{"default":"","type":"string","maxLength":70}},"required":["position","kind"],"additionalProperties":false}},"externalUsage":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"personalNumber":{"type":"string","pattern":"^\\d{12}$"},"rot":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"rut":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"green":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["personalNumber","rot","rut"],"additionalProperties":false}},"correction":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000},"hours":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hours":{"type":"number","minimum":0,"maximum":999}},"required":["position","hours"],"additionalProperties":false}}},"required":["reason","hours"],"additionalProperties":false}},"required":["invoiceId","paymentIds","costs","externalUsage"],"additionalProperties":false}},"confirmed":{"type":"boolean","const":true},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","name","date","entries","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submit"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id","version","date","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancel"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":1000},"withdrawn":{"default":false,"type":"boolean"}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"decision"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":1,"maxLength":100},"cases":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approved":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["id","approved"],"additionalProperties":false}},"reason":{"type":"string","minLength":3,"maxLength":1000},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceJson":{"type":"string","maxLength":1048576}},"required":["kind","id","version","date","reference","cases","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"transfer"},"caseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"direction":{"default":"to_customer","type":"string","enum":["to_customer","to_tax"]},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":3,"maxLength":1000},"customerResponsible":{"type":"boolean","const":true}},"required":["kind","caseId","date","amount","reason","customerResponsible"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"return"},"caseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"settlementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":3,"maxLength":1000},"customerResponsible":{"type":"boolean"}},"required":["kind","caseId","settlementId","date","reason","customerResponsible"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"amend"},"caseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"previousDecisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"approved":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"refundDue":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reference":{"type":"string","minLength":1,"maxLength":100},"reason":{"type":"string","minLength":3,"maxLength":1000},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"confirmed":{"type":"boolean","const":true}},"required":["kind","caseId","previousDecisionId","date","approved","refundDue","reference","reason","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"refundCustomer"},"caseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"settlementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","caseId","settlementId","date","amount","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 2097152 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/reminders":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getReminders","description":"Påminnelse, separat ränta/avgift, betalning, återbetalning, efterskänkning och makulering.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnReminders","description":"Påminnelse, separat ränta/avgift, betalning, återbetalning, efterskänkning och makulering.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"payBy":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"terms":{"type":"object","properties":{"interest":{"type":"string","enum":["none","statutory","contract"]},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startBasis":{"type":"string","enum":["agreed_due","notice"]},"noticeSent":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReceived":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"evidence":{"type":"string","minLength":3,"maxLength":1000},"annualRate":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"rateThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"feeAgreed":{"type":"boolean"},"excludedPositions":{"maxItems":40,"type":"array","items":{"type":"integer","minimum":1,"maximum":40}},"interestAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"confirmed":{"type":"boolean","const":true}},"required":["interest","start","startBasis","evidence","rateThrough","feeAgreed","excludedPositions","interestAccount","feeAccount","confirmed"],"additionalProperties":false},"fee":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"exchangeRate":{"type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"rateSource":{"type":"string","minLength":1,"maxLength":150},"text":{"default":"","type":"string","maxLength":2000},"kind":{"type":"string","const":"issue"},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"send":{"type":"boolean"},"to":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"emailText":{"type":"string","maxLength":2000}},"required":["invoiceId","date","payBy","terms","fee","exchangeRate","rateSource","kind","previewHash","send","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"followup"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"paused":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":1000},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"followUpOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","invoiceId","paused","reason","ownerId","followUpOn"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"issueBatch"},"items":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"payBy":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"terms":{"type":"object","properties":{"interest":{"type":"string","enum":["none","statutory","contract"]},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startBasis":{"type":"string","enum":["agreed_due","notice"]},"noticeSent":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReceived":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"evidence":{"type":"string","minLength":3,"maxLength":1000},"annualRate":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"rateThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"feeAgreed":{"type":"boolean"},"excludedPositions":{"maxItems":40,"type":"array","items":{"type":"integer","minimum":1,"maximum":40}},"interestAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"confirmed":{"type":"boolean","const":true}},"required":["interest","start","startBasis","evidence","rateThrough","feeAgreed","excludedPositions","interestAccount","feeAccount","confirmed"],"additionalProperties":false},"fee":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"exchangeRate":{"type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"rateSource":{"type":"string","minLength":1,"maxLength":150},"text":{"default":"","type":"string","maxLength":2000},"kind":{"type":"string","const":"issue"},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"send":{"type":"boolean"},"to":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"emailText":{"type":"string","maxLength":2000}},"required":["invoiceId","date","payBy","terms","fee","exchangeRate","rateSource","kind","previewHash","send","to"],"additionalProperties":false}}},"required":["kind","items"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"refund"},"paymentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"reference":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","paymentId","date","amount","actualSEK","accountCode","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settle"},"chargeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mode":{"type":"string","enum":["payment","waiver"]},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"actualSEK":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"reference":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","chargeId","mode","date","amount","actualSEK","accountCode","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"void"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","date","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"send"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"to":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","to","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/agreements":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgreements","description":"Granskade återkommande fakturor, paus och periodhistorik. Själva körningen är intern för separat worker.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnAgreements","description":"Granskade återkommande fakturor, paus och periodhistorik. Själva körningen är intern för separat worker.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"save"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"sourceInvoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"interval":{"type":"string","enum":["week","month","quarter","year"]},"end":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"to":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"note":{"default":"","type":"string","maxLength":1000},"billing":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceKey":{"type":"string","const":"clarent-software"}},"required":["serviceKey"],"additionalProperties":false},"schedule":{"type":"object","properties":{"firstInvoiceDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"unit":{"type":"string","enum":["day","week","month","quarter","year"]},"every":{"type":"integer","minimum":1,"maximum":120},"invoicesPerBatch":{"type":"integer","minimum":1,"maximum":12},"totalInvoices":{"anyOf":[{"type":"integer","minimum":1,"maximum":5200},{"type":"null"}]},"delivery":{"type":"string","enum":["email","manual"]},"exceptions":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":5199},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"skip":{"default":false,"type":"boolean"}},"required":["index"],"additionalProperties":false}},"advance":{"type":"object","properties":{"vatTiming":{"type":"string","enum":["payment","construction_invoice"]},"balanceAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"basis":{"type":"string","minLength":10,"maxLength":1000}},"required":["vatTiming","balanceAccount","basis"],"additionalProperties":false}},"required":["firstInvoiceDate","unit","every","invoicesPerBatch","totalInvoices","delivery","exceptions"],"additionalProperties":false},"invoice":{"type":"object","properties":{"lines":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"originalPosition":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":40},{"type":"null"}]},"articleId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":500},"quantity":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})(\\.\\d{1,3})?$"},"unit":{"default":"st","type":"string","minLength":1,"maxLength":15},"unitPrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,10})(\\.\\d{1,6})?$"},"discount":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"vatRate":{"type":"string","enum":["0","6","12","25"]},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"taxTreatment":{"default":"domestic","type":"string","enum":["domestic","exempt","reverse"]},"taxNote":{"default":"","type":"string","maxLength":300},"deductible":{"default":"100","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"reverseCharge":{"type":"object","properties":{"purchase":{"type":"string","enum":["eu_service_25","outside_eu_service_25"]},"basis":{"default":"","type":"string","maxLength":500},"confirmed":{"default":false,"type":"boolean"}},"required":["purchase"],"additionalProperties":false},"salesVat":{"type":"object","properties":{"treatment":{"type":"string","enum":["eu_goods","eu_service","triangulation","export_goods","outside_service","domestic_reverse"]},"reportingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"},"vatCheck":{"type":"object","properties":{"checkId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"string","pattern":"^[A-Z]{2}[A-Z0-9]{2,12}$"},"checkedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":500},"valid":{"type":"boolean","const":true}},"required":["number","checkedOn","reference","valid"],"additionalProperties":false}},"required":["treatment","reportingDate"],"additionalProperties":false},"customerVatReview":{"type":"object","properties":{"profile":{"type":"string","const":"eu_vat"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"}},"required":["profile"],"additionalProperties":false},"work":{"default":null,"anyOf":[{"type":"object","properties":{"scheme":{"type":"string","enum":["rot","rut","green_solar","green_storage","green_charger"]},"category":{"type":"string","minLength":1,"maxLength":70},"hours":{"type":"integer","minimum":0,"maximum":999}},"required":["scheme","category","hours"],"additionalProperties":false},{"type":"null"}]},"costCenter":{"default":"","type":"string","maxLength":30},"project":{"default":"","type":"string","maxLength":30}},"required":["description","quantity","unitPrice","vatRate","accountCode"],"additionalProperties":false}},"text":{"type":"string","maxLength":2000},"paymentDays":{"type":"integer","minimum":0,"maximum":365},"reference":{"type":"string","maxLength":100},"ourReference":{"type":"string","maxLength":100}},"required":["lines","text","paymentDays","reference","ourReference"],"additionalProperties":false}},"required":["name","sourceInvoiceId","start","interval","end","to"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"activate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean","const":true}},"required":["kind","id","version","previewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pause","end","skip"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["kind","id","version","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/interest":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getInterest","description":"Granskade räntefakturor för sent slutbetalda original. Utkast grupperas per kund, valuta och språk och bokförs genom ordinarie fakturaflöde.","responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"actOnInterest","description":"Granskade räntefakturor för sent slutbetalda original. Utkast grupperas per kund, valuta och språk och bokförs genom ordinarie fakturaflöde.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"payBy":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"exchangeRate":{"type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"rateSource":{"type":"string","minLength":1,"maxLength":150},"minimumInterest":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"minimumScope":{"default":"original","type":"string","enum":["original","group"]},"sources":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"terms":{"type":"object","properties":{"interest":{"type":"string","enum":["none","statutory","contract"]},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startBasis":{"type":"string","enum":["agreed_due","notice"]},"noticeSent":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReceived":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"evidence":{"type":"string","minLength":3,"maxLength":1000},"annualRate":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"rateThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"feeAgreed":{"type":"boolean"},"excludedPositions":{"maxItems":40,"type":"array","items":{"type":"integer","minimum":1,"maximum":40}},"interestAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"confirmed":{"type":"boolean","const":true}},"required":["interest","start","startBasis","evidence","rateThrough","feeAgreed","excludedPositions","interestAccount","feeAccount","confirmed"],"additionalProperties":false}},"required":["invoiceId","terms"],"additionalProperties":false}},"fees":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reminderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"agreementEvidence":{"type":"string","minLength":3,"maxLength":1000},"sentConfirmed":{"type":"boolean"}},"required":["invoiceId","reminderId","amount","accountCode","agreementEvidence","sentConfirmed"],"additionalProperties":false}},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean","const":true}},"required":["date","payBy","currency","exchangeRate","rateSource","sources","previewHash","confirmed"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON. Separata fil- och radgränser gäller också."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/periodizations/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewPeriodization","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sourceJournalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourcePosition":{"type":"integer","minimum":1,"maximum":100},"sourceAllocationKey":{"type":"string","minLength":1,"maxLength":80},"allocatedAmount":{"type":"string","pattern":"^\\d{1,13}(?:\\.\\d{1,2})?$"},"balanceAccount":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":120},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["sourceJournalId","sourcePosition","balanceAccount","firstMonth","months","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/periodizations/stop-preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewPeriodizationStop","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["id","version","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/periodizations/batch-preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewPeriodizationBatch","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"selections":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"positions":{"minItems":1,"maxItems":120,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":120}}},"required":["id","version","positions"],"additionalProperties":false}}},"required":["through","selections"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/reminders/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewReminder","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"payBy":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"terms":{"type":"object","properties":{"interest":{"type":"string","enum":["none","statutory","contract"]},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startBasis":{"type":"string","enum":["agreed_due","notice"]},"noticeSent":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReceived":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"evidence":{"type":"string","minLength":3,"maxLength":1000},"annualRate":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"rateThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"feeAgreed":{"type":"boolean"},"excludedPositions":{"maxItems":40,"type":"array","items":{"type":"integer","minimum":1,"maximum":40}},"interestAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"confirmed":{"type":"boolean","const":true}},"required":["interest","start","startBasis","evidence","rateThrough","feeAgreed","excludedPositions","interestAccount","feeAccount","confirmed"],"additionalProperties":false},"fee":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"exchangeRate":{"type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"rateSource":{"type":"string","minLength":1,"maxLength":150},"text":{"default":"","type":"string","maxLength":2000}},"required":["invoiceId","date","payBy","terms","fee","exchangeRate","rateSource"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/interest/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewInterest","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"payBy":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"exchangeRate":{"type":"string","pattern":"^(0|[1-9]\\d{0,5})(\\.\\d{1,8})?$"},"rateSource":{"type":"string","minLength":1,"maxLength":150},"minimumInterest":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"minimumScope":{"default":"original","type":"string","enum":["original","group"]},"sources":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"terms":{"type":"object","properties":{"interest":{"type":"string","enum":["none","statutory","contract"]},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startBasis":{"type":"string","enum":["agreed_due","notice"]},"noticeSent":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReceived":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"evidence":{"type":"string","minLength":3,"maxLength":1000},"annualRate":{"default":"0","type":"string","pattern":"^\\d{1,3}(\\.\\d{1,2})?$"},"rateThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"feeAgreed":{"type":"boolean"},"excludedPositions":{"maxItems":40,"type":"array","items":{"type":"integer","minimum":1,"maximum":40}},"interestAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"feeAccount":{"anyOf":[{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},{"type":"string","const":""}]},"confirmed":{"type":"boolean","const":true}},"required":["interest","start","startBasis","evidence","rateThrough","feeAgreed","excludedPositions","interestAccount","feeAccount","confirmed"],"additionalProperties":false}},"required":["invoiceId","terms"],"additionalProperties":false}},"fees":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reminderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"agreementEvidence":{"type":"string","minLength":3,"maxLength":1000},"sentConfirmed":{"type":"boolean"}},"required":["invoiceId","reminderId","amount","accountCode","agreementEvidence","sentConfirmed"],"additionalProperties":false}}},"required":["date","payBy","currency","exchangeRate","rateSource","sources"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/agreements/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewAgreement","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 65536 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/housework/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewHousework","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"entries":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"paymentIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"costs":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["material","other"]},"category":{"default":"","type":"string","maxLength":70}},"required":["position","kind"],"additionalProperties":false}},"externalUsage":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"personalNumber":{"type":"string","pattern":"^\\d{12}$"},"rot":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"rut":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"green":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["personalNumber","rot","rut"],"additionalProperties":false}},"correction":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000},"hours":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hours":{"type":"number","minimum":0,"maximum":999}},"required":["position","hours"],"additionalProperties":false}}},"required":["reason","hours"],"additionalProperties":false}},"required":["invoiceId","paymentIds","costs","externalUsage"],"additionalProperties":false}}},"required":["date","entries"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 2097152 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/housework/decision-preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewHouseworkDecision","description":"Förhandsgranskning utan bokföring eller åtgärdsnyckel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"raw":{"type":"string","maxLength":1048576}},"required":["requestId","raw"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 2097152 byte JSON."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/currency":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCurrencyQuote","parameters":[{"name":"currency","in":"query","required":true,"schema":{"type":"string","enum":["AUD","BRL","CAD","CHF","CNY","CZK","DKK","EUR","GBP","HKD","HUF","IDR","ILS","INR","ISK","JPY","KRW","MXN","MYR","NOK","NZD","PHP","PLN","RON","SGD","THB","TRY","USD","ZAR"]}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."},"429":{"description":"Kurskällans anropsgräns har nåtts."},"502":{"description":"Källan är tillfälligt otillgänglig."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-reports":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getInvoiceReport","parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["kundreskontra","leverantorsreskontra","kundaldersanalys","leverantorsaldersanalys","artikelforsaljning"]}},{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"includePaid","in":"query","required":false,"schema":{"default":false,"type":"boolean"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","pdf","xlsx"],"default":"json"}}],"responses":{"200":{"description":"Historisk reskontra, åldersanalys eller artikelkvantiteter; datumurvalet gäller samtliga betalningar och krav.","content":{"application/json":{},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices/attachments":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readCustomerInvoiceDocuments","description":"Sök och sidindela kundfakturors dokument oberoende av fakturalistan. Kandidater, granskad koppling och export använder samma behöriga domäntjänst. Befintliga dokument behåller sin åtkomst.","parameters":[{"name":"q","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"state","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","linked","unlinked"]}},{"name":"type","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","invoice","reminder","original"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":1000000}},{"name":"invoiceId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["list","candidates","review","export"]}},{"name":"fileId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx"]}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}},"post":{"operationId":"selectOrLinkCustomerInvoiceDocument","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"description":"Välj en befintlig allmän dokumentversion som kundfakturaunderlag eller bekräfta en granskad fakturakoppling. Inget original kopieras och ingen dokumentåtkomst utökas.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"select"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","fileId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","fileId","invoiceId","reviewHash"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices/documents":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"downloadSelectedInvoiceDocuments","description":"Sammanfoga högst 100 bokförda fakturors PDF-dokument. Leverantörsfakturans kopplade originalsidor ingår i stabil ordning.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["customer","supplier"]},"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Sammanfogade fakturadokument.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"För många original, sidor eller byte i urvalet."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/files/{fileId}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadCommerceFile","description":"Skyddad nedladdning efter kontroll av bolag, dataklass och mottagare.","responses":{"200":{"description":"Bevarade filbytes; Content-Type och Content-Disposition anger filen.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices/{invoiceId}/document":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadInvoiceDocument","description":"Skyddad nedladdning efter kontroll av bolag, dataklass och mottagare.","responses":{"200":{"description":"Bevarade filbytes; Content-Type och Content-Disposition anger filen.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/deliveries/{messageId}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadCapturedMessage","description":"Skyddad nedladdning efter kontroll av bolag, dataklass och mottagare.","responses":{"200":{"description":"Bevarade filbytes; Content-Type och Content-Disposition anger filen.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoices/{invoiceId}/original":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readLinkedInvoiceOriginal","description":"Läs ett säkerhetskontrollerat original som är kopplat till exakt denna faktura. Fakturans modulbehörighet och bolag kontrolleras även för förhandsvisning.","parameters":[{"name":"sourceType","in":"query","required":true,"schema":{"type":"string","enum":["commerce","receipt","quarantine"]}},{"name":"sourceId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"preview","in":"query","schema":{"type":"boolean","default":false}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"Originalbytes eller renderad PDF-sida i JSON vid förhandsvisning.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/json":{}}},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/files":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"uploadCommerceFile","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"purpose":{"type":"string","enum":["original","logo"],"default":"original"},"invoiceId":{"type":"string","format":"uuid"}},"required":["file"],"additionalProperties":false}}}},"responses":{"201":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 20971520 byte fil, samt högst 16 KiB formulärmetadata."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"description":"PDF, PNG, JPEG eller HEIC-original upp till 20 MiB. Logotyp: PNG/JPEG, högst 4 MiB. Högst 20 original per faktura/verifikation. Signatur och kopplingsbehörighet kontrolleras."}},"/agencies/{agencyId}/companies/{companyId}/questions/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewQuestionAttachment","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"page":{"type":"integer","minimum":1}},"required":["file"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 20971520 byte fil, samt högst 16 KiB formulärmetadata."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}},"description":"Behörighets- och säkerhetskontrollerad PDF-förhandsvisning. Inget original eller svar registreras."}},"/agencies/{agencyId}/companies/{companyId}/questions/answer":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"answerQuestionWithAttachment","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":10},"next":{"type":"string","enum":["keep","customer","done"]},"internal":{"type":"boolean"},"missing":{"type":"boolean"},"references":{"type":"string","description":"JSON-array med befintliga filreferenser. Behörigheter ändras aldrig."},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"text":{"type":"string","maxLength":4000}},"required":["id","version"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 52428800 byte fil, samt högst 16 KiB formulärmetadata."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/bank-transactions/import":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewOrImportBankStatement","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","format":"uuid"},"description":"Obligatorisk för mode=import. Förhandsgranskning kräver ingen nyckel."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"accountId":{"type":"string","format":"uuid"},"mode":{"type":"string","enum":["detect","preview","import"]},"options":{"type":"string","description":"JSON enligt ImportOptions","contentMediaType":"application/json","contentSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"format":{"type":"string","enum":["csv","xlsx","camt","bgmax"]},"delimiter":{"default":";","type":"string","enum":[";",",","\t"]},"decimal":{"default":",","type":"string","enum":[",","."]},"encoding":{"default":"utf8","type":"string","enum":["utf8","windows1252"]},"sheet":{"default":"","type":"string","maxLength":100},"columns":{"type":"object","properties":{"date":{"type":"string","minLength":1,"maxLength":100},"amount":{"type":"string","minLength":1,"maxLength":100},"text":{"default":"","type":"string","maxLength":100},"reference":{"default":"","type":"string","maxLength":100},"counterparty":{"default":"","type":"string","maxLength":100},"transactionId":{"default":"","type":"string","maxLength":100},"currency":{"default":"","type":"string","maxLength":100}},"required":["date","amount"],"additionalProperties":false}},"required":["format"],"additionalProperties":false}}},"required":["file","accountId","mode","options"],"additionalProperties":false}}}},"responses":{"200":{"description":"Förhandsgranskning, inga poster skapade."},"201":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"413":{"description":"Högst 52428800 byte fil, samt högst 16 KiB formulärmetadata."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/tax-account/import":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"importTaxAccount","description":"Förhandsgranskning eller import av högst 50 MiB text/CSV/XLSX. mode preview kräver ingen nyckel; import kräver Idempotency-Key och reviewHash från förhandsgranskningen. input är JSON enligt taxImportSchema.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","input","mode"],"properties":{"file":{"type":"string","format":"binary"},"input":{"type":"string","description":"{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\",\"minLength\":1,\"maxLength\":180},\"accountCode\":{\"type\":\"string\",\"pattern\":\"^\\\\d{4}$\"},\"openingBalance\":{\"type\":\"string\",\"pattern\":\"^-?(0|[1-9]\\\\d{0,12})(\\\\.\\\\d{1,2})?$\"},\"closingBalance\":{\"type\":\"string\",\"pattern\":\"^-?(0|[1-9]\\\\d{0,12})(\\\\.\\\\d{1,2})?$\"},\"order\":{\"type\":\"string\",\"enum\":[\"ascending\",\"descending\"]},\"options\":{\"type\":\"object\",\"properties\":{\"format\":{\"type\":\"string\",\"enum\":[\"csv\",\"xlsx\",\"camt\",\"bgmax\"]},\"delimiter\":{\"default\":\";\",\"type\":\"string\",\"enum\":[\";\",\",\",\"\\t\"]},\"decimal\":{\"default\":\",\",\"type\":\"string\",\"enum\":[\",\",\".\"]},\"encoding\":{\"default\":\"utf8\",\"type\":\"string\",\"enum\":[\"utf8\",\"windows1252\"]},\"sheet\":{\"default\":\"\",\"type\":\"string\",\"maxLength\":100},\"columns\":{\"type\":\"object\",\"properties\":{\"date\":{\"type\":\"string\",\"minLength\":1,\"maxLength\":100},\"amount\":{\"type\":\"string\",\"minLength\":1,\"maxLength\":100},\"text\":{\"default\":\"\",\"type\":\"string\",\"maxLength\":100},\"reference\":{\"default\":\"\",\"type\":\"string\",\"maxLength\":100},\"counterparty\":{\"default\":\"\",\"type\":\"string\",\"maxLength\":100},\"transactionId\":{\"default\":\"\",\"type\":\"string\",\"maxLength\":100},\"currency\":{\"default\":\"\",\"type\":\"string\",\"maxLength\":100}},\"required\":[\"date\",\"amount\"],\"additionalProperties\":false}},\"required\":[\"format\"],\"additionalProperties\":false}},\"required\":[\"name\",\"accountCode\",\"openingBalance\",\"closingBalance\",\"order\",\"options\"],\"additionalProperties\":false}"},"mode":{"enum":["detect","preview","import"]},"reviewHash":{"type":"string"}}}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/payroll/files/{id}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadPayrollFile","description":"Endast människa med payroll.read eller lönebeskedets egen aktiva bolagsmottagare. Privat no-store.","responses":{"200":{"description":"Originalbytes med rätt innehållstyp, filnamn och privat cachepolicy."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/tax-account/files/{id}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadTaxAccountOriginal","description":"Endast människa med bank.read i samma bolag.","responses":{"200":{"description":"Originalbytes med rätt innehållstyp, filnamn och privat cachepolicy."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-opening/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewInvoiceOpening","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"number","const":0},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true},"rows":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["customer","supplier"]},"documentType":{"type":"string","enum":["invoice","credit"]},"partyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":"string","minLength":1,"maxLength":80},"originalReference":{"default":"","type":"string","maxLength":80},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"originalTotal":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"},"remaining":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"},"bookSEK":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"},"booked":{"type":"boolean"},"controlAccount":{"default":"","type":"string","pattern":"^(?:\\d{4})?$"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ocr":{"default":"","type":"string","pattern":"^\\d{0,25}$"},"allocations":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^\\d{4}$"},"amount":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"}},"required":["accountCode","amount"],"additionalProperties":false}}},"required":["id","kind","documentType","partyId","reference","invoiceDate","dueDate","currency","originalTotal","remaining","bookSEK","booked","fileId","allocations"],"additionalProperties":false}}},"required":["version","fiscalYearId","startOn","basis","reviewed","rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-opening/adjustments/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewOpeningAdjustment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":10,"maxLength":1500},"journalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reviewed":{"type":"boolean","const":true},"rows":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"remaining":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"}},"required":["invoiceId","remaining"],"additionalProperties":false}}},"required":["date","reason","journalId","reviewed","rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/invoice-opening/adjustments":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"commitOpeningAdjustment","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":10,"maxLength":1500},"journalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reviewed":{"type":"boolean","const":true},"rows":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"remaining":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"}},"required":["invoiceId","remaining"],"additionalProperties":false}}},"required":["date","reason","journalId","reviewed","rows"],"additionalProperties":false},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["input","reviewHash"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/reconciliations/report":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"exportReconciliationReport","description":"Fryst avstämningsrapport eller filtrerad periodöversikt. PDF, Excel eller JSON med gemensamt datum och urval.","parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"id","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"account","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":120}},{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","maxLength":30}},{"name":"mode","in":"query","required":false,"schema":{"default":"report","type":"string","enum":["report","overview"]}},{"name":"format","in":"query","required":false,"schema":{"default":"pdf","type":"string","enum":["pdf","xlsx","json"]}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/agencies/{agencyId}/companies/{companyId}/reconciliations/status":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readReconciliationAccountStatus","description":"Senaste tolv periodernas granskningsstatus för bankens konto.","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Resultat från samma domäntjänst som arbetsvyn. Exakta belopp och nummer är strängar."},"400":{"description":"Innehåll eller obligatoriskt åtgärds-ID saknas."},"401":{"description":"Giltig inloggning krävs."},"403":{"description":"Mänsklig identitet, rätt bolag och åtgärdens behörigheter krävs. AI- och worker-identiteter får inte läsa dessa underlag."},"404":{"description":"Posten saknas eller är inte tillgänglig i urvalet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt. Upprepa osäkert anrop med samma nyckel och exakt samma innehåll."},"415":{"description":"Fel innehållstyp."},"422":{"description":"Uppgifterna eller den aktuella affärshändelsen är ogiltiga. Servern kontrollerar konto, period, saldo och mandat."}}}},"/dialogs":{"get":{"operationId":"agencyDialogs","summary":"Samlad kunddialog för behöriga byråklienter. Frågor och äldre kommentarer projiceras utan kopiering.","parameters":[{"name":"q","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","maxLength":200}},{"name":"filter","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"needs","type":"string","enum":["all","needs","mine","unassigned","waiting","closed","unread","history"]}},{"name":"agencyId","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"companyId","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"ownerId","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"page","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":1,"type":"integer","minimum":1,"maximum":100000}}],"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/agencies/{agencyId}/companies/{companyId}/dialogs":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readDialogs","summary":"Dialoglista, exakt tråd/meddelande eller eget privat serverutkast. Ingen årsfilt­rering.","parameters":[{"name":"q","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","maxLength":200}},{"name":"filter","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"needs","type":"string","enum":["all","needs","mine","unassigned","waiting","closed","unread","history"]}},{"name":"agencyId","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"companyId","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"ownerId","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"page","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"thread","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"before","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"message","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"draft","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}},"post":{"operationId":"actOnDialog","summary":"Skapa ämne, svara, intern anteckning, tilldela, status, personligt läsläge eller privat utkast. Idempotens och versionskontroll.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"subject":{"type":"string","minLength":3,"maxLength":160},"text":{"type":"string","minLength":1,"maxLength":10000},"files":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["document","upload"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"context":{"default":{"kind":"company","id":null},"type":"object","properties":{"kind":{"type":"string","enum":["company","invoice","journal","kyc","engagement","document","legacy"]},"id":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind"],"additionalProperties":false},"participants":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind","id","subject","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reply"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","maxLength":10000},"files":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["document","upload"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"replyTo":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"internal":{"default":false,"type":"boolean"},"next":{"default":"keep","type":"string","enum":["keep","waiting","closed"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","text","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"status"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["new","in_progress","waiting","closed"]}},"required":["kind","id","version","status"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"assign"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"participants":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind","id","version","ownerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"readQuestion"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"read"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"draft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"subject":{"default":"","type":"string","maxLength":160},"text":{"default":"","type":"string","maxLength":10000},"files":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["document","upload"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"replyTo":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"internal":{"default":false,"type":"boolean"},"context":{"default":{"kind":"company","id":null},"type":"object","properties":{"kind":{"type":"string","enum":["company","invoice","journal","kyc","engagement","document","legacy"]},"id":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind"],"additionalProperties":false}},"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."},"409":{"description":"Versionskonflikt: hämta och jämför."}}}},"/agencies/{agencyId}/companies/{companyId}/dialogs/upload":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"uploadDialogOriginal","summary":"Kontrollerat original för en uttrycklig meddelandebilaga. Ny åtkomst uppstår först när bilagan skickas i en tillgänglig dialog.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/agencies/{agencyId}/dialog-policy":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readDialogPolicy","responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}},"post":{"operationId":"saveDialogPolicy","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"policy"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"responseHours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"backupId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","version","responseHours","backupId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"availability"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailableUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["kind","version","unavailableUntil"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/notices":{"get":{"operationId":"getNotices","summary":"Gemensam händelse- och uppgiftskälla över identitetens bolag. AI får enbart behörig metadata.","parameters":[{"name":"agencyId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"companyId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"handlerId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"type","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["eu.changed","task.dialog","task.dialog_waiting","dialog.followup","dialog.assigned","dialog.updated","task.contract","task.kyc","task.kyc_waiting","kyc.ready","calendar.confirmation","export.ready","export.failed","calendar.planning","inbox.file_received","inbox.received","inbox.unopened","guest.expiring","guest.expired","message.received","support.updated","question.asked","question.answered","question.reopened","invoice.created","invoice.credit_draft","invoice.issued","invoice.approved","invoice.rejected","invoice.interpreted","invoice.delivery_captured","invoice.delivery_queued","delivery.failed","document.uploaded","receipt.claim_updated","receipt.payment_updated","receipt.uploaded","period.lock_warning","task.cash_draft","task.cash_difference","task.cash_settlement","task.bank","task.approval","task.incoming","task.issued","task.paying","task.question_open","task.question_answered","task.payment_ack","task.payment_report","task.delivery"]}},{"name":"category","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"all","type":"string","enum":["all","event","task"]}},{"name":"unread","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":false,"type":"boolean"}},{"name":"since","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"until","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"cursor","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":400}},{"name":"limit","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":100,"type":"integer","minimum":1,"maximum":250}}],"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."}}},"post":{"operationId":"markNotices","summary":"Markera en händelse eller ett tidsavgränsat urval som läst. Inga nya händelser efter urvalets until-tid markeras.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"one"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"key":{"type":"string","maxLength":180},"read":{"type":"boolean"}},"required":["kind","agencyId","companyId","key","read"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"all"},"query":{"type":"object","properties":{"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"handlerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["eu.changed","task.dialog","task.dialog_waiting","dialog.followup","dialog.assigned","dialog.updated","task.contract","task.kyc","task.kyc_waiting","kyc.ready","calendar.confirmation","export.ready","export.failed","calendar.planning","inbox.file_received","inbox.received","inbox.unopened","guest.expiring","guest.expired","message.received","support.updated","question.asked","question.answered","question.reopened","invoice.created","invoice.credit_draft","invoice.issued","invoice.approved","invoice.rejected","invoice.interpreted","invoice.delivery_captured","invoice.delivery_queued","delivery.failed","document.uploaded","receipt.claim_updated","receipt.payment_updated","receipt.uploaded","period.lock_warning","task.cash_draft","task.cash_difference","task.cash_settlement","task.bank","task.approval","task.incoming","task.issued","task.paying","task.question_open","task.question_answered","task.payment_ack","task.payment_report","task.delivery"]},"category":{"default":"all","type":"string","enum":["all","event","task"]},"unread":{"default":false,"type":"boolean"},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"cursor":{"type":"string","maxLength":400},"limit":{"default":100,"type":"integer","minimum":1,"maximum":250}},"additionalProperties":false}},"required":["kind","query"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/notices/digests":{"get":{"operationId":"listNoticeDigests","summary":"Egna lokalt fångade sammanställningar, grupperade över tillgängliga bolag.","responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/notices/digests/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"downloadNoticeDigest","summary":"EML med fortfarande behöriga händelser och öppna arbetsuppgifter. Ingen extern leverans.","responses":{"200":{"description":"MIME-meddelande","content":{"message/rfc822":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/agencies/{agencyId}/notice-preferences":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"saveNoticePreference","summary":"Eget val eller administratörens byråstandard: inget, dagligen, direkt eller veckovis. Notiscentret förblir på.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"type":"string","enum":["agency","me"]},"inherit":{"type":"boolean"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"mode":{"type":"string","enum":["none","daily","immediate","weekly"]},"weekday":{"type":"integer","minimum":1,"maximum":7},"hour":{"type":"integer","minimum":0,"maximum":23}},"required":["target","version","mode","weekday","hour"],"additionalProperties":false}}}},"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/agencies/{agencyId}/companies/{companyId}/messages":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readMessages","summary":"Mänsklig bolagstråd eller kommentarer på behörig faktura/verifikation. Löneunderlag kräver separat rätt.","parameters":[{"name":"source","in":"query","schema":{"type":"string","enum":["company","invoice","journal"]}},{"name":"subject","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"before","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}},"post":{"operationId":"addMessage","summary":"Lägg till ett oföränderligt meddelande. Samma försök skapar aldrig en dubblett.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"source":{"type":"object","properties":{"kind":{"type":"string","enum":["company","invoice","journal"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","id"],"additionalProperties":false},"text":{"type":"string","minLength":1,"maxLength":10000},"replyTo":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["source","text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Behörigt urval. Tidsstämplar är ISO 8601 och dialogutdrag visas enbart för behöriga mänskliga mottagare. Interna anteckningar ingår aldrig."},"403":{"description":"Mänsklig användare med aktuell rättighet krävs."}}}},"/agencies/{agencyId}/branding":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyBranding","summary":"Byråns tema, materialrättigheter och domänförberedelser.","responses":{"200":{"description":"Granskat resultat. Inget utskick eller extern domänaktivering."},"403":{"description":"Kräver människa med separat byråadministratörs- respektive leverantörsbehörighet."},"409":{"description":"Version eller åtgärds-ID har ändrats."},"422":{"description":"Uppgifter eller kontroll saknas."}}},"post":{"operationId":"reviewAgencyBranding","summary":"Spara byråtema eller förbered/stäng domän. Ändrar aldrig den ursprungliga byråadressen.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"save"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]{2,39}$"},"body":{"type":"object","properties":{"brandName":{"type":"string","minLength":2,"maxLength":80,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"accent":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"panel":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"foreground":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"muted":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"font":{"type":"string","enum":["plex","montserrat"]},"wordmarkFont":{"type":"string","enum":["same","cormorant"]},"credit":{"type":"boolean"},"supportName":{"type":"string","minLength":2,"maxLength":100,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"supportEmail":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"logoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"iconId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"backgroundId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"videoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["brandName","accent","background","panel","foreground","muted","font","wordmarkFont","credit","supportName","supportEmail","logoId","iconId","backgroundId","videoId"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["kind","version","slug","body","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"domain"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"hostname":{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z][a-z0-9-]{1,62}$"},"usage":{"type":"string","enum":["login","outgoing","incoming"]},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","hostname","usage","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"disableDomain"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":5,"maxLength":500,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"}},"required":["kind","id","version","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Granskat resultat. Inget utskick eller extern domänaktivering."},"403":{"description":"Kräver människa med separat byråadministratörs- respektive leverantörsbehörighet."},"409":{"description":"Version eller åtgärds-ID har ändrats."},"422":{"description":"Uppgifter eller kontroll saknas."}}}},"/agencies/{agencyId}/branding/assets":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readAgencyBrandAsset","summary":"Behörigt byråmaterial med stöd för byte-intervall i video.","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"PNG, JPEG eller MP4 med privat cachekontroll."},"206":{"description":"Begärt byte-intervall."},"403":{"description":"Kräver människa med separat byråadministratörs- respektive leverantörsbehörighet."},"409":{"description":"Version eller åtgärds-ID har ändrats."},"416":{"description":"Ogiltigt byte-intervall."},"422":{"description":"Uppgifter eller kontroll saknas."}}},"post":{"operationId":"uploadAgencyBrandAsset","summary":"PNG/JPEG upp till 4 MB, MP4 upp till 50 MB; dokumenterad materialrätt och filkontroll krävs.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"purpose":{"type":"string","enum":["logo","icon","background","video"]},"mediaType":{"type":"string","enum":["image/png","image/jpeg","video/mp4"]},"base64":{"type":"string","maxLength":75497472},"rightsReference":{"type":"string","minLength":5,"maxLength":1000,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"reviewed":{"type":"boolean","const":true}},"required":["name","purpose","mediaType","base64","rightsReference","reviewed"],"additionalProperties":false}}}},"responses":{"200":{"description":"Granskat resultat. Inget utskick eller extern domänaktivering."},"403":{"description":"Kräver människa med separat byråadministratörs- respektive leverantörsbehörighet."},"409":{"description":"Version eller åtgärds-ID har ändrats."},"422":{"description":"Uppgifter eller kontroll saknas."}}}},"/product/onboarding":{"get":{"operationId":"getAgencyOnboarding","summary":"Leverantörens pågående byråuppläggningar och inbjudningsstatus.","responses":{"200":{"description":"Granskat resultat. Inget utskick eller extern domänaktivering."},"403":{"description":"Kräver människa med separat byråadministratörs- respektive leverantörsbehörighet."},"409":{"description":"Version eller åtgärds-ID har ändrats."},"422":{"description":"Uppgifter eller kontroll saknas."}}},"post":{"operationId":"createAgencyAfterContact","summary":"Skapa separat byrå med låst organisationsnummer, tema och namngiven första administratörsinbjudan. Inga klienträttigheter till leverantören.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":2,"maxLength":160,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"organizationNumber":{"type":"string","pattern":"^\\d{6}-\\d{4}$"},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]{2,39}$"},"adminEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"reference":{"type":"string","minLength":5,"maxLength":1000,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"brand":{"type":"object","properties":{"brandName":{"type":"string","minLength":2,"maxLength":80,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"accent":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"panel":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"foreground":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"muted":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"font":{"type":"string","enum":["plex","montserrat"]},"wordmarkFont":{"type":"string","enum":["same","cormorant"]},"credit":{"type":"boolean"},"supportName":{"type":"string","minLength":2,"maxLength":100,"pattern":"^[^\\r\\n\\x00-\\x1f]*$"},"supportEmail":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"logoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"iconId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"backgroundId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"videoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["brandName","accent","background","panel","foreground","muted","font","wordmarkFont","credit","supportName","supportEmail","logoId","iconId","backgroundId","videoId"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["id","name","organizationNumber","slug","adminEmail","reference","brand","reviewed"],"additionalProperties":false}}}},"responses":{"200":{"description":"Granskat resultat. Inget utskick eller extern domänaktivering."},"403":{"description":"Kräver människa med separat byråadministratörs- respektive leverantörsbehörighet."},"409":{"description":"Version eller åtgärds-ID har ändrats."},"422":{"description":"Uppgifter eller kontroll saknas."}}}},"/lifecycle-access":{"get":{"operationId":"getLifecycleAgencyAccess","summary":"Byråer där den inloggade personen är medarbetare. Ger inte i sig rätt att ändra klientavslut.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/product":{"get":{"operationId":"getProductAdministration","summary":"Leverantörens leads, driftinformation, abonnemang och kostnader. Ger ingen klientåtkomst.","parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string"}},{"name":"mail","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar.","content":{"application/json":{"schema":{"type":"object"}},"message/rfc822":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageProductAdministration","summary":"Leverantörens leads, driftinformation, abonnemang och kostnader. Ger ingen klientåtkomst.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"cost"},"body":{"type":"object","properties":{"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"agencyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"category":{"type":"string","enum":["infrastructure","backup","psd2","peppol","kivra","lookup","mail","scanning","monitoring","transfer","migration","legal","security","support","regulations","oncall"]},"amount":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},{"type":"null"}]},"basis":{"type":"string","enum":["unknown","measurement","quote","assumption"]},"reference":{"type":"string","minLength":5,"maxLength":1000},"owner":{"type":"string","minLength":2,"maxLength":120},"observedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["month","agencyId","clientId","category","amount","basis","reference","owner","observedOn"],"additionalProperties":false}},"required":["id","version","kind","body"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"incident"},"body":{"type":"object","properties":{"title":{"type":"string","minLength":5,"maxLength":160},"description":{"type":"string","minLength":10,"maxLength":5000},"severity":{"type":"string","enum":["notice","degraded","outage","maintenance"]},"state":{"type":"string","enum":["investigating","identified","monitoring","resolved","scheduled"]},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"published":{"type":"boolean"}},"required":["title","description","severity","state","startsAt","endsAt","published"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","body","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"lead"},"status":{"type":"string","enum":["new","contacted","demo","quoted","won","lost"]},"notes":{"type":"string","maxLength":4000}},"required":["id","version","kind","status","notes"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"support"},"status":{"type":"string","enum":["new","investigating","resolved"]},"notes":{"type":"string","maxLength":4000}},"required":["id","version","kind","status","notes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"contract"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"body":{"type":"object","properties":{"reference":{"type":"string","minLength":5,"maxLength":500},"tiers":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from":{"type":"integer","minimum":1,"maximum":1000000},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["from","price"],"additionalProperties":false}},"fixedTotal":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},{"type":"null"}]},"basePrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"discountPercent":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"included":{"type":"string","minLength":5,"maxLength":2000},"addons":{"type":"string","maxLength":2000},"cancellationDeadline":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"billingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"paymentDays":{"type":"integer","minimum":1,"maximum":365},"quotaGb":{"type":"integer","minimum":1,"maximum":10000},"extraGbPrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["reference","tiers","fixedTotal","basePrice","discountPercent","included","addons","cancellationDeadline","billingDate","paymentDays","quotaGb","extraGbPrice"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","agencyId","startsOn","endsOn","body","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"threshold":{"type":"integer","minimum":1,"maximum":200}},"required":["kind","version","threshold"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"invoice"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"string","minLength":1,"maxLength":80},"periodMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"paymentDays":{"type":"integer","minimum":1,"maximum":365},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"status":{"type":"string","enum":["draft","sent","paid","credited"]},"reference":{"type":"string","minLength":5,"maxLength":1000}},"required":["id","version","kind","agencyId","number","periodMonth","invoiceDate","dueDate","paymentDays","amount","status","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"captureLead"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/support":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSupportTickets","summary":"Tekniska ärenden: medarbetares egna, administratörens byråurval och företagsanvändarens egna bolagsärenden. Publika svar, återöppning, granskad kontext och separat namngiven supportåtkomst. Inga klientdata eller mejl skickas automatiskt.","parameters":[{"name":"companyId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"view","in":"query","required":false,"schema":{"type":"string"}},{"name":"id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageSupportTickets","summary":"Tekniska ärenden: medarbetares egna, administratörens byråurval och företagsanvändarens egna bolagsärenden. Publika svar, återöppning, granskad kontext och separat namngiven supportåtkomst. Inga klientdata eller mejl skickas automatiskt.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"companyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"title":{"type":"string","minLength":5,"maxLength":160},"attempted":{"type":"string","minLength":5,"maxLength":2000},"description":{"type":"string","minLength":10,"maxLength":5000},"expected":{"type":"string","minLength":3,"maxLength":2000},"steps":{"default":"","type":"string","maxLength":3000},"impact":{"type":"object","properties":{"affected":{"type":"string","enum":["me","company","agency","unknown"]},"continuity":{"type":"string","enum":["yes","workaround","blocked"]},"dataConcern":{"type":"string","enum":["no","suspected","unknown"]}},"required":["affected","continuity","dataConcern"],"additionalProperties":false},"context":{"type":"object","properties":{"path":{"type":"string","maxLength":500,"pattern":"^\\/workspace(?:\\/[a-zA-Z0-9_/-]*)?$"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"errorId":{"default":"","type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]*$"}},"required":["path","occurredAt"],"additionalProperties":false},"emailNotify":{"default":false,"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","companyId","title","attempted","description","expected","impact","context","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"reply"},"message":{"type":"string","minLength":3,"maxLength":5000}},"required":["id","version","kind","message"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"reopen"},"message":{"type":"string","minLength":5,"maxLength":5000}},"required":["id","version","kind","message"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"subscribe"},"emailNotify":{"type":"boolean"}},"required":["id","version","kind","emailNotify"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"triage"},"status":{"type":"string","enum":["new","investigating","waiting","resolved"]},"priority":{"type":"string","enum":["normal","high","critical"]},"message":{"type":"string","maxLength":5000},"solution":{"type":"string","maxLength":5000},"internalNote":{"type":"string","maxLength":5000}},"required":["id","version","kind","status","priority","message","solution","internalNote"],"additionalProperties":false}]},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"accessCreate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"principalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"years":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"sections":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["system","journals","reports","registers","vat","documents"]}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"reason":{"type":"string","minLength":5,"maxLength":1000},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","companyId","principalId","years","sections","expiresAt","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"accessRevoke"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"grantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","grantId","version"],"additionalProperties":false}]}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/product/support":{"get":{"operationId":"getVendorSupportConversation","summary":"Separat leverantörsbehörighet: sökbar ärendelista med sidindelning, ärendedialog, prioritering, svar till anmälaren och avskilda interna anteckningar.","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageVendorSupportConversation","summary":"Separat leverantörsbehörighet: sökbar ärendelista med sidindelning, ärendedialog, prioritering, svar till anmälaren och avskilda interna anteckningar.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"companyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"title":{"type":"string","minLength":5,"maxLength":160},"attempted":{"type":"string","minLength":5,"maxLength":2000},"description":{"type":"string","minLength":10,"maxLength":5000},"expected":{"type":"string","minLength":3,"maxLength":2000},"steps":{"default":"","type":"string","maxLength":3000},"impact":{"type":"object","properties":{"affected":{"type":"string","enum":["me","company","agency","unknown"]},"continuity":{"type":"string","enum":["yes","workaround","blocked"]},"dataConcern":{"type":"string","enum":["no","suspected","unknown"]}},"required":["affected","continuity","dataConcern"],"additionalProperties":false},"context":{"type":"object","properties":{"path":{"type":"string","maxLength":500,"pattern":"^\\/workspace(?:\\/[a-zA-Z0-9_/-]*)?$"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"errorId":{"default":"","type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]*$"}},"required":["path","occurredAt"],"additionalProperties":false},"emailNotify":{"default":false,"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","companyId","title","attempted","description","expected","impact","context","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"reply"},"message":{"type":"string","minLength":3,"maxLength":5000}},"required":["id","version","kind","message"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"reopen"},"message":{"type":"string","minLength":5,"maxLength":5000}},"required":["id","version","kind","message"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"subscribe"},"emailNotify":{"type":"boolean"}},"required":["id","version","kind","emailNotify"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"triage"},"status":{"type":"string","enum":["new","investigating","waiting","resolved"]},"priority":{"type":"string","enum":["normal","high","critical"]},"message":{"type":"string","maxLength":5000},"solution":{"type":"string","maxLength":5000},"internalNote":{"type":"string","maxLength":5000}},"required":["id","version","kind","status","priority","message","solution","internalNote"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/profile":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyProfile","summary":"Byråns avtalsuppgifter. Organisationsnumret kan inte ändras.","parameters":[{"name":"view","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAgencyProfile","summary":"Byråns avtalsuppgifter. Organisationsnumret kan inte ändras.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":180},"organizationNumber":{"type":"string"},"address":{"type":"string","maxLength":2000},"email":{"type":"string"},"phone":{"type":"string","maxLength":60},"website":{"type":"string","maxLength":200}},"required":["name","organizationNumber","address","email","phone","website"],"additionalProperties":false}},"required":["version","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/contract-templates":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getContractTemplates","summary":"Versionssatta egna avtalsmallar och bilagor.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageContractTemplates","summary":"Versionssatta egna avtalsmallar och bilagor.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":180},"kind":{"type":"string","enum":["agreement","appendix"]},"text":{"type":"string","minLength":10,"maxLength":40000},"active":{"type":"boolean"}},"required":["name","kind","text","active"],"additionalProperties":false}},"required":["version","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/people":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyPeople","summary":"Separat behöriga privatpersoner, klientkopplingar och uppdrag.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAgencyPeople","summary":"Separat behöriga privatpersoner, klientkopplingar och uppdrag.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create-service"},"personId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":160},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"interval":{"type":"string","enum":["weekly","monthly","quarterly","semiannual","yearly","once"]},"firstDueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"estimateMinutes":{"type":"integer","minimum":0,"maximum":100000},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"active":{"type":"boolean"},"reminderDays":{"type":"integer","minimum":0,"maximum":365},"warningDays":{"type":"integer","minimum":0,"maximum":365},"comment":{"type":"string","maxLength":4000}},"required":["name","startOn","endOn","interval","firstDueOn","estimateMinutes","assigneeId","active"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","personId","name","body","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"person"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"identityType":{"default":"swedish","type":"string","enum":["swedish","coordination","foreign","none"]},"identityCountry":{"default":"","type":"string","pattern":"^([A-Z]{2})?$"},"nationalId":{"type":"string","maxLength":80},"privateCustomer":{"default":null,"type":["boolean","null"]},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"phone":{"type":"string","maxLength":40},"address":{"type":"string","maxLength":400},"note":{"type":"string","maxLength":4000},"active":{"type":"boolean"}},"required":["name","nationalId","email","phone","address","note","active"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"personId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"object","properties":{"role":{"type":"string","maxLength":160},"roles":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["owner","board","contact","representative","other"]}},"share":{"type":["string","null"]},"basis":{"type":"string","maxLength":4000},"active":{"type":"boolean"},"validFrom":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"validThrough":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["role","share","basis","active"],"additionalProperties":false}},"required":["kind","version","personId","companyId","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"engagement"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"personId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":160},"active":{"type":"boolean"}},"required":["kind","version","personId","name","active"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"service"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"personId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"engagementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"interval":{"type":"string","enum":["weekly","monthly","quarterly","semiannual","yearly","once"]},"firstDueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"estimateMinutes":{"type":"integer","minimum":0,"maximum":100000},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"active":{"type":"boolean"},"reminderDays":{"type":"integer","minimum":0,"maximum":365},"warningDays":{"type":"integer","minimum":0,"maximum":365},"comment":{"type":"string","maxLength":4000}},"required":["name","startOn","endOn","interval","firstDueOn","estimateMinutes","assigneeId","active"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","version","personId","engagementId","body","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"generate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"personId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","id","version","personId","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"activity"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"personId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"estimateMinutes":{"type":"integer","minimum":0,"maximum":100000},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string","enum":["todo","waiting","received","in_progress","done"]},"comment":{"type":"string","maxLength":4000}},"required":["kind","id","version","personId","dueOn","estimateMinutes","assigneeId","status","comment"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/lifecycle":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getLifecycle","summary":"Klienters och byråns arbetsåtkomst, uppsägning och arkivläsning. Tid ensam raderar inga data.","parameters":[{"name":"view","in":"query","required":false,"schema":{"type":"string"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageLifecycle","summary":"Klienters och byråns arbetsåtkomst, uppsägning och arkivläsning. Tid ensam raderar inga data.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"plan"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"action":{"type":"string","enum":["plan","finish","access","reactivate","cancel"]},"endsOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"destination":{"type":"string","enum":["transfer","leave","continuation"]},"reason":{"type":"string","minLength":5,"maxLength":2000},"customerReadUntil":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"archiveAccess":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"principalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["principalId","through"],"additionalProperties":false}},"archivePurpose":{"type":"string","maxLength":2000},"archiveReference":{"type":"string","maxLength":1000},"reviewHash":{"type":"string","minLength":64,"maxLength":64},"reviewed":{"type":"boolean","const":true}},"required":["kind","companyId","version","action","endsOn","destination","reason","customerReadUntil","archiveAccess","archivePurpose","archiveReference","reviewHash","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"client"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["prospect","active","terminated","disconnected","archived"]},"endsOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"body":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":2000},"archiveReaders":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"archiveUntil":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"archivePurpose":{"type":"string","maxLength":2000},"archiveReference":{"type":"string","maxLength":1000},"exitDestination":{"type":"string","enum":["transfer","leave","continuation"]},"customerReadUntil":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"archivePermissionCeiling":{"type":"object","propertyNames":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"archiveAccess":{"type":"array","items":{"type":"object","properties":{"principalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"permissions":{"type":"array","items":{"type":"string"}}},"required":["principalId","through","permissions"],"additionalProperties":false}}},"required":["reason","archiveReaders","archiveUntil","archivePurpose","archiveReference"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["kind","companyId","version","status","endsOn","body","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"closeAgency"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":5,"maxLength":2000},"reviewed":{"type":"boolean","const":true}},"required":["kind","version","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agency"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"type":"string","enum":["active","cancelled"]},"cancelledOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"workUntil":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"readUntil":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"body":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":2000},"completion":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":5,"maxLength":2000}},"required":["date","reference"],"additionalProperties":false},"writtenNotice":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"recipient":{"type":"string","minLength":3,"maxLength":300},"reference":{"type":"string","minLength":5,"maxLength":1000}},"required":["date","recipient","reference"],"additionalProperties":false},{"type":"null"}]},"archiveContract":{"anyOf":[{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":5,"maxLength":1000},"monthlyPrice":{"type":"string","pattern":"^(0|[1-9]\\d{0,9})(\\.\\d{1,2})?$"}},"required":["from","through","reference"],"additionalProperties":false},{"type":"null"}]}},"required":["reason","writtenNotice","archiveContract"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["kind","version","state","cancelledOn","body","reviewed"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/transfers":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyTransfers","summary":"Granskat byråbyte med båda byråernas medgivande och separat internt förvar.","parameters":[{"name":"companyId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"targetAgencyId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"vault","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAgencyTransfers","summary":"Granskat byråbyte med båda byråernas medgivande och separat internt förvar.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"offer"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetAgencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewHash":{"type":"string","minLength":64,"maxLength":64},"approval":{"type":"object","properties":{"organizationNumber":{"type":"string","minLength":6,"maxLength":30},"mandate":{"type":"string","minLength":5,"maxLength":2000},"reference":{"type":"string","minLength":5,"maxLength":2000},"readUntil":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewed":{"type":"boolean","const":true},"vaultUntil":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"vaultPurpose":{"type":"string","minLength":5,"maxLength":2000},"vaultReference":{"type":"string","minLength":5,"maxLength":2000}},"required":["organizationNumber","mandate","reference","readUntil","reviewed","vaultUntil","vaultPurpose","vaultReference"],"additionalProperties":false}},"required":["kind","companyId","targetAgencyId","reviewHash","approval"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"accept"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewHash":{"type":"string","minLength":64,"maxLength":64},"approval":{"type":"object","properties":{"organizationNumber":{"type":"string","minLength":6,"maxLength":30},"mandate":{"type":"string","minLength":5,"maxLength":2000},"reference":{"type":"string","minLength":5,"maxLength":2000},"readUntil":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewed":{"type":"boolean","const":true},"payroll":{"type":"boolean"}},"required":["organizationNumber","mandate","reference","readUntil","reviewed","payroll"],"additionalProperties":false}},"required":["kind","id","reviewHash","approval"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancel"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","id","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"vaultAccess"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"readers":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"purpose":{"type":"string","minLength":5,"maxLength":2000},"reference":{"type":"string","minLength":5,"maxLength":2000},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","readers","through","purpose","reference","reviewed"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/auditors":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCompanyAuditors","summary":"Bolagets tidsbegränsade revisorsåtkomst. Kräver administratörsrätt eller uttryckligen tilldelad auditor.manage med läsrätt till underlaget.","parameters":[{"name":"invitation","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"view","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageCompanyAuditors","summary":"Bolagets tidsbegränsade revisorsåtkomst. Kräver administratörsrätt eller uttryckligen tilldelad auditor.manage med läsrätt till underlaget.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"create"},"email":{"type":"string"},"years":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"payroll":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reason":{"type":"string","maxLength":1000},"reviewed":{"type":"boolean","const":true}},"required":["action","email","years","payroll","expiresAt","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"extend"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reviewed":{"type":"boolean","const":true}},"required":["action","id","version","expiresAt","reviewed"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"revoke"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["action","id","version"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/guest-access":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getGuestGrants","summary":"Revisorsinbjudningar och tidsbegränsad namngiven support. Avgränsas även per år och dataklass.","parameters":[{"name":"invitation","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageGuestGrants","summary":"Revisorsinbjudningar och tidsbegränsad namngiven support. Avgränsas även per år och dataklass.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"create"},"kind":{"type":"string","enum":["support","auditor"]},"companyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"principalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"years":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"payroll":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reason":{"type":"string","minLength":5,"maxLength":1000}},"required":["action","kind","companyId","principalId","email","years","payroll","expiresAt","reason"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"extend"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","id","version","expiresAt"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"revoke"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["action","id","version"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/billing":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyBilling","summary":"Versionshanterade kundpriser, programkostnader, kundunderlag och programmarginal. Fakturautkast innebär inget utskick.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx","customer-pdf","customer-zip"]}},{"name":"month","in":"query","required":false,"schema":{"type":"string"}},{"name":"view","in":"query","required":false,"schema":{"type":"string"}},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"clientIds","in":"query","required":false,"schema":{"type":"string"}},{"name":"statementId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string"}},{"name":"invoiceDate","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string"}},{"name":"group","in":"query","required":false,"schema":{"type":"string"}},{"name":"responsible","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAgencyBilling","summary":"Versionshanterade kundpriser, programkostnader, kundunderlag och programmarginal. Fakturautkast innebär inget utskick.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"priceRule"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetType":{"type":"string","enum":["default","client","group"]},"targetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"fixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"activeOnly":{"type":"boolean"},"fixedKind":{"default":"program","type":"string","enum":["program","bundle"]},"programAllocation":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},{"type":"null"}]},"serviceFixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"modules":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"module":{"type":"string","enum":["bookkeeping","supplier","customer","payroll","documents"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"when":{"type":"string","enum":["enabled","used"]},"enabled":{"type":"boolean"}},"required":["module","price","when"],"additionalProperties":false}},"variables":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["journals","supplierInvoices","paymentOrders","customerInvoices","customerSent","reminders","payslips","employeesPaid","documents","interpretedDocuments","pages","receipts","clientUsers"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"included":{"type":"integer","minimum":0,"maximum":100000000},"includedAll":{"type":"boolean"}},"required":["metric","price"],"additionalProperties":false}},"note":{"type":"string","maxLength":1000}},"required":["fixed","activeOnly","variables","note"],"additionalProperties":false}},"required":["kind","id","targetType","targetId","month","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"costRule"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetType":{"type":"string","enum":["default","client","group"]},"targetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"perCompany":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},{"type":"null"}]},"extraFixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"variables":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["journals","supplierInvoices","paymentOrders","customerInvoices","customerSent","reminders","payslips","employeesPaid","documents","interpretedDocuments","pages","receipts","clientUsers"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["metric","price"],"additionalProperties":false}},"source":{"type":"string","const":"estimate"},"note":{"type":"string","maxLength":1000}},"required":["perCompany","extraFixed","variables","source","note"],"additionalProperties":false}},"required":["kind","id","targetType","targetId","month","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"periodRule"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetType":{"type":"string","enum":["default","client","group"]},"targetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"endsOn":{"anyOf":[{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},{"type":"null"}]},"excluded":{"type":"boolean"},"note":{"type":"string","maxLength":1000}},"required":["endsOn","excluded","note"],"additionalProperties":false}},"required":["kind","id","targetType","targetId","month","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"invoiceCompanyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"account":{"type":"string","pattern":"^\\d{4}$"},"vatRate":{"type":"string","enum":["0","6","12","25"]},"taxNote":{"type":"string","maxLength":300},"paymentDays":{"type":"integer","minimum":1,"maximum":365}},"required":["invoiceCompanyId","account","vatRate","taxNote","paymentDays"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"price"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"fixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"activeOnly":{"type":"boolean"},"fixedKind":{"default":"program","type":"string","enum":["program","bundle"]},"programAllocation":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},{"type":"null"}]},"serviceFixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"modules":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"module":{"type":"string","enum":["bookkeeping","supplier","customer","payroll","documents"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"when":{"type":"string","enum":["enabled","used"]},"enabled":{"type":"boolean"}},"required":["module","price","when"],"additionalProperties":false}},"variables":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["journals","supplierInvoices","paymentOrders","customerInvoices","customerSent","reminders","payslips","employeesPaid","documents","interpretedDocuments","pages","receipts","clientUsers"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"included":{"type":"integer","minimum":0,"maximum":100000000},"includedAll":{"type":"boolean"}},"required":["metric","price"],"additionalProperties":false}},"note":{"type":"string","maxLength":1000}},"required":["fixed","activeOnly","variables","note"],"additionalProperties":false}},"required":["kind","id","clientId","month","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lock"},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reviewed":{"type":"boolean","const":true},"clientIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"purpose":{"type":"string","enum":["export","invoice"]},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","maxLength":1000}},"required":["kind","month","reviewHash","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"invoices"},"monthId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"clientIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"reviewed":{"type":"boolean","const":true},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","monthId","invoiceDate","clientIds","reviewed"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/archive":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"exportAgencyArchive","summary":"Helexport av behöriga byrådokument, privatpersoner och bolagsarkiv.","parameters":[],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/people/export/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","xlsx"]}}],"post":{"operationId":"exportPeopleList","summary":"Exportera exakt filtrerat och behörigt personurval.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["people","activities","links"]},"personId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"q":{"default":"","type":"string","maxLength":200},"inactive":{"default":false,"type":"boolean"},"state":{"type":"string","enum":["active","inactive","all"]},"privateCustomer":{"default":false,"type":"boolean"},"related":{"default":false,"type":"boolean"},"companyId":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]},"sort":{"default":"name","type":"string","enum":["name","name-desc"]},"from":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"to":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"assignee":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]},"hideDone":{"default":false,"type":"boolean"}},"required":["kind"],"additionalProperties":false}}}},"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/people/search":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"searchPeopleDirectory","summary":"Sök och filtrera behöriga personposter utan identifierare i URL. Sidindelad läsning.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"default":"","type":"string","maxLength":200},"state":{"default":"active","type":"string","enum":["active","inactive","all"]},"privateCustomer":{"default":false,"type":"boolean"},"related":{"default":false,"type":"boolean"},"companyId":{"default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]},"sort":{"default":"name","type":"string","enum":["name","name-desc"]},"page":{"default":1,"type":"integer","minimum":1,"maximum":100000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/people/duplicates":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"findPersonDuplicates","summary":"Läs tillgängliga personposter med samma identifierare. Ingen sammanslagning.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"exclude":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"identityType":{"type":"string","enum":["swedish","coordination","foreign","none"]},"identityCountry":{"default":"","type":"string","maxLength":2},"nationalId":{"type":"string","maxLength":80}},"required":["identityType","nationalId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/guest-access":{"get":{"operationId":"openGuestGrant","summary":"Lista egna granskningsuppdrag eller öppna ett uttryckligt bolag och år. Sluttid och indragning kontrolleras vid varje fil och export.","parameters":[{"name":"grantId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"companyId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"yearId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"section","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["overview","journals","journal","reports","registers","vat","history","documents","payroll","system","export","sie"]}},{"name":"subjectId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"file","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/inbox":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getInbox","summary":"Behörig inkorg med original, mejl, avsändargranskning och papperskorg.","parameters":[{"name":"mailId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"tab","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"files","type":"string","enum":["files","linked","mail","senders","trash"]}},{"name":"filter","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"all","type":"string","enum":["all","unread","handled","spam","newsletter"]}},{"name":"from","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"to","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"sender","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","maxLength":254}},{"name":"search","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","maxLength":180}},{"name":"page","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":1,"type":"integer","minimum":1,"maximum":100000}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageInbox","summary":"Behörig inkorg med original, mejl, avsändargranskning och papperskorg.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"reviewAuthentication"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["kind","id","version","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"prepareReceipt"},"sourceType":{"type":"string","enum":["receipt","commerce","quarantine"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","sourceType","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"addresses"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"sender"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"type":"string","enum":["trusted","blocked"]}},"required":["kind","email","version","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"read"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"read":{"type":"boolean"}},"required":["kind","id","read"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"mail"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"category":{"type":"string","enum":["normal","spam","newsletter"]},"handled":{"type":"boolean"},"trashed":{"type":"boolean"},"senderApproved":{"type":"boolean"}},"required":["kind","id","version","category","handled","trashed","senderApproved"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"file"},"sourceType":{"type":"string","enum":["receipt","commerce","quarantine"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"trashed":{"type":"boolean"},"linkedKind":{"anyOf":[{"type":"string","enum":["journal","invoice"]},{"type":"null"}]},"linkedId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","sourceType","id","version","trashed","linkedKind","linkedId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"preferences"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"notify":{"type":"boolean"},"email":{"type":"boolean"},"reminderDays":{"type":"integer","minimum":1,"maximum":90}},"required":["kind","version","notify","email","reminderDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"processMail"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"destination":{"type":"string","enum":["underlag","interpretation"]}},"required":["kind","id","version","destination"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"rescan"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/inbox/file":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadInboxFile","summary":"Kontrollerat original eller säker JPEG-förhandsvisning.","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"sourceType","in":"query","required":true,"schema":{"type":"string","enum":["receipt","commerce","quarantine"]}},{"name":"preview","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/inbox/targets":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"searchInboxTargets","summary":"Sök behöriga bokförda verifikationer och fakturor för underlagskoppling.","parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["journal","invoice"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/inbox/mail/{mailId}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"mailId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readInboxMail","summary":"Behörigt mejl som ren text utan aktivt HTML-innehåll.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/vat-number":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"checkVatNumber","summary":"Kontrollera VAT-nummer direkt mot EU-kommissionens VIES. Sparar svarets identitet och datum. Kräver aktiverad adapter.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"vatNumber":{"type":"string","maxLength":30}},"required":["vatNumber"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/years":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getFiscalYears","summary":"Räkenskapsår, årspreferenser och spårbar preliminär/slutlig UB till IB.","parameters":[{"name":"sourceYearId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"targetYearId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageFiscalYears","summary":"Räkenskapsår, årspreferenser och spårbar preliminär/slutlig UB till IB.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"changeDates"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"previousStartsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"previousEndsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","fiscalYearId","previousStartsOn","previousEndsOn","startsOn","endsOn"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"automatic":{"type":"boolean"},"defaultYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","version","automatic","defaultYearId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"nextYear"},"sourceYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["accrual","cash"]}},"required":["kind","sourceYearId","method"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"transfer"},"sourceYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceHash":{"type":"string","minLength":64,"maxLength":64},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"type":"string","enum":["preliminary","final"]},"basis":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","sourceYearId","targetYearId","sourceHash","version","state","basis"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/deviations":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getDeviationReviews","summary":"Avvikelsekontroll med månadskvittens eller återkommande förklaring.","parameters":[{"name":"month","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^\\d{4}-(?:0[1-9]|1[0-2])$"}},{"name":"dimensionId","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[1-9]\\d{0,9}$"}},{"name":"objectCode","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","maxLength":100}},{"name":"showAcknowledged","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"false","type":"string","enum":["true","false"]}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","pdf","xlsx"]}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar.","content":{"application/json":{"schema":{"type":"object"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageDeviationReviews","summary":"Avvikelsekontroll med månadskvittens eller återkommande förklaring.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","const":"review"},"query":{"type":"object","properties":{"month":{"type":"string","pattern":"^\\d{4}-(?:0[1-9]|1[0-2])$"},"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"objectCode":{"type":"string","maxLength":100},"showAcknowledged":{"default":"false","type":"string","enum":["true","false"]}},"additionalProperties":false},"accountCode":{"type":"string","maxLength":30},"fingerprint":{"type":"string","minLength":64,"maxLength":64},"scope":{"type":"string","enum":["month","recurring"]},"state":{"type":"string","enum":["acknowledged","reopened"]},"comment":{"type":"string","minLength":3,"maxLength":1500}},"required":["kind","query","accountCode","fingerprint","scope","state","comment"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/list-exports":{"get":{"operationId":"exportAgencyList","summary":"Exportera hela det behöriga urvalet i byråns listor.","parameters":[{"name":"list","in":"query","required":true,"schema":{"type":"string","enum":["billing","clients","engagements","processes","staff","groups"]}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx"]}},{"name":"inline","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"agencyId","in":"query","required":false,"schema":{"type":"string"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string"}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"favorites","in":"query","required":false,"schema":{"type":"string"}},{"name":"group","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}},{"name":"staff","in":"query","required":false,"schema":{"type":"string"}},{"name":"kyc","in":"query","required":false,"schema":{"type":"string"}},{"name":"contract","in":"query","required":false,"schema":{"type":"string"}},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"member","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"hideDone","in":"query","required":false,"schema":{"type":"string"}},{"name":"showWithdrawn","in":"query","required":false,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"showEnded","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/workspace/receipts/{receiptId}/case":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"receiptId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getReceiptCase","summary":"Granska samma kvitto, attestera, koppla bokföring och registrera verifierad ersättning med separat behörighet","parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["accounting","payment"]}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["bank","payroll"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"journalId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageReceiptCase","summary":"Granska samma kvitto, attestera, koppla bokföring och registrera verifierad ersättning med separat behörighet","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"claimPrepare"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"claimVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"policyVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"beneficiaryName":{"type":"string","minLength":2,"maxLength":200},"beneficiaryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,11})(\\.\\d{1,2})?$"},"currency":{"type":"string","const":"SEK"},"basis":{"type":"string","minLength":5,"maxLength":1000},"approverId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["beneficiaryName","beneficiaryId","amount","currency","basis","approverId"],"additionalProperties":false},"confirmed":{"type":"boolean","const":true}},"required":["kind","version","claimVersion","policyVersion","body","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"claimDecide"},"claimVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"decision":{"type":"string","enum":["approve","reject"]},"reason":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true}},"required":["kind","claimVersion","decision","reason","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"claimCancel"},"claimVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true}},"required":["kind","claimVersion","reason","confirmed"],"additionalProperties":false},{"type":"object","properties":{"claimVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,11})(\\.\\d{1,2})?$"},"reference":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true},"kind":{"type":"string","const":"reimburseBank"},"bankRowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"bankVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["claimVersion","amount","reference","confirmed","kind","bankRowId","bankVersion"],"additionalProperties":false},{"type":"object","properties":{"claimVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"amount":{"type":"string","pattern":"^(0|[1-9]\\d{0,11})(\\.\\d{1,2})?$"},"reference":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true},"kind":{"type":"string","const":"reimbursePayroll"},"payrollRunId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payrollVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payItemId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["claimVersion","amount","reference","confirmed","kind","payrollRunId","payrollVersion","employeeId","payItemId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reimburseCorrect"},"reimbursementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true}},"required":["kind","reimbursementId","reason","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"details"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"payer":{"default":"unknown","type":"string","enum":["unknown","company","self","other"]},"purpose":{"default":"","type":"string","maxLength":500},"purchasedOn":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"merchant":{"default":"","type":"string","maxLength":200},"amount":{"default":null,"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,2})?$"},{"type":"null"}]},"currency":{"default":null,"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beneficiaryName":{"default":"","type":"string","maxLength":200}},"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"review"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"handlerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reviewed":{"type":"boolean"}},"required":["kind","version","handlerId","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"accounting"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"accountingVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"linked":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true}},"required":["kind","version","accountingVersion","journalId","linked","reason","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"bankMatch"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rows":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"reason":{"type":"string","minLength":3,"maxLength":1000},"confirmed":{"type":"boolean","const":true}},"required":["kind","version","journalId","rows","reason","confirmed"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/workspace/receipt-policy":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getReceiptPolicy","summary":"Läs bolagets attestpolicy; ändring kräver commerce.configure och aktuell version","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageReceiptPolicy","summary":"Läs bolagets attestpolicy; ändring kräver commerce.configure och aktuell version","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"requiresApproval":{"default":true,"type":"boolean"},"defaultApproverId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"allowOwnApproval":{"default":false,"type":"boolean"}},"additionalProperties":false}},"required":["version","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/list-exports":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"exportWorkspaceList","summary":"Exporterar listans hela behöriga urval, oberoende av sidindelning. Kopplade kund- och leverantörsunderlag strömmas med oförändrade original och fakturaförteckning.","parameters":[{"name":"list","in":"query","required":true,"schema":{"type":"string","enum":["invoices","registers","supplier-attachments","customer-attachments","members","invitations","payroll-list","bookkeeping-settings","accounts","bank-connections","reminders","interest","invoice-opening","inbox","payment-candidates","agreements","housework","asset-list","journals","receipts","activities","bank","questions","deliveries","periodizations","cash","tax-account","reconciliations","bank-accounts","payment-files"]}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx","zip"]}},{"name":"inline","in":"query","required":false,"schema":{"type":"string","enum":["true"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string"}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"party","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"dueFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"dueTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"min","in":"query","required":false,"schema":{"type":"string"}},{"name":"max","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string"}},{"name":"account","in":"query","required":false,"schema":{"type":"string"}},{"name":"content","in":"query","required":false,"schema":{"type":"string"}},{"name":"approver","in":"query","required":false,"schema":{"type":"string"}},{"name":"series","in":"query","required":false,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"invoiceId","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"mine","in":"query","required":false,"schema":{"type":"string"}},{"name":"due","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"sender","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"asOf","in":"query","required":false,"schema":{"type":"string"}},{"name":"tab","in":"query","required":false,"schema":{"type":"string"}},{"name":"yearId","in":"query","required":false,"schema":{"type":"string"}},{"name":"fiscalYearId","in":"query","required":false,"schema":{"type":"string"}},{"name":"section","in":"query","required":false,"schema":{"type":"string"}},{"name":"onlyOverdue","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"purchasedThrough","in":"query","required":false,"schema":{"type":"string"}},{"name":"remainingOnly","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/eu-sales":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getEuSales","summary":"Periodisk sammanställning med granskade fakturor, kompletteringar, rättelser och inlämningshistorik.","parameters":[{"name":"workflow","in":"query","required":false,"schema":{"type":"string","enum":["true"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["month","quarter"]}},{"name":"id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"check","in":"query","required":false,"schema":{"type":"string","enum":["true"]}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","pdf","xlsx","txt"]}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar.","content":{"application/json":{"schema":{"type":"object"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"text/plain":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageEuSales","summary":"Periodisk sammanställning med granskade fakturor, kompletteringar, rättelser och inlämningshistorik.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"journalReview"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"included":{"type":"boolean"},"vatNumber":{"type":"string","maxLength":14},"category":{"type":"string","enum":["goods","services","triangulation"]},"reason":{"type":"string","minLength":5,"maxLength":1000}},"required":["kind","journalId","position","version","hash","included","vatNumber","category","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"historyReview"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"additionalGoods":{"type":"string","pattern":"^-?(?:0|[1-9]\\d{0,14})(?:\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1000}},"required":["kind","from","to","version","hash","additionalGoods","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"contact":{"type":"object","properties":{"name":{"type":"string","maxLength":35},"phone":{"type":"string","maxLength":17},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]}},"required":["name","phone","email"],"additionalProperties":false},"frequency":{"type":"string","enum":["month","quarter"]},"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"decisionReference":{"type":"string","maxLength":500},"historyReviewed":{"type":"boolean"}},"required":["contact","frequency","effectiveFrom","decisionReference"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reviewInvoice"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"vatNumber":{"type":"string","pattern":"^[A-Z]{2}[A-Z0-9]{2,12}$"},"body":{"type":"object","properties":{"treatment":{"type":"string","enum":["eu_goods","eu_service","triangulation","export_goods","outside_service","domestic_reverse"]},"reportingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"default":"","type":"string","maxLength":2000},"confirmed":{"default":false,"type":"boolean"},"vatCheck":{"type":"object","properties":{"checkId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"string","pattern":"^[A-Z]{2}[A-Z0-9]{2,12}$"},"checkedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":500},"valid":{"type":"boolean","const":true}},"required":["number","checkedOn","reference","valid"],"additionalProperties":false}},"required":["treatment","reportingDate"],"additionalProperties":false}},"required":["kind","invoiceId","position","version","vatNumber","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"supplement"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"vatNumber":{"type":"string","pattern":"^[A-Z]{2}[A-Z0-9]{2,12}$"},"category":{"type":"string","enum":["goods","services","triangulation","X","Y","Z"]},"amount":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9]\\d{0,14})(?:\\.\\d{1,2})?$"},{"type":"null"}]},"oldVatNumber":{"default":"","type":"string","maxLength":14},"reference":{"type":"string","minLength":5,"maxLength":1000},"journalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"archived":{"type":"boolean"},"confirmed":{"type":"boolean","const":true}},"required":["date","vatNumber","category","amount","reference","journalId","archived","confirmed"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"finalize"},"period":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"frequency":{"type":"string","enum":["month","quarter"]}},"required":["from","to","frequency"],"additionalProperties":false},"hash":{"type":"string","minLength":64,"maxLength":64},"reason":{"type":"string","minLength":5,"maxLength":2000},"reconciliationReviewed":{"type":"boolean","const":true},"contact":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":35,"pattern":"^[^;\\r\\n]+$"},"phone":{"type":"string","maxLength":17,"pattern":"^(?:\\+[0-9]{1,16}|[0-9]+(?:-[0-9]+)?)$"},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]}},"required":["name","phone","email"],"additionalProperties":false}},"required":["kind","period","hash","reason","reconciliationReviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submitted"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"submittedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","submittedOn","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submission_revoked"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","id","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/eu-sales/worklist":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"manageEuSalesWorklist","summary":"Registrera dokumenterad extern hantering eller granskning utan rapporteringsplikt, alternativt återöppna beslutet. Skickar ingen sammanställning.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["done","reopened"]},"period":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"frequency":{"type":"string","enum":["month","quarter"]}},"required":["from","to","frequency"],"additionalProperties":false},"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"resolution":{"type":"object","properties":{"method":{"type":"string","enum":["external","not_required"]},"handledOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","maxLength":500},"note":{"type":"string","minLength":10,"maxLength":2000},"confirmed":{"type":"boolean","const":true}},"required":["method","handledOn","reference","note","confirmed"],"additionalProperties":false}},"required":["kind","period","hash","version"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/eu-sales/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewEuSales","summary":"Granska periodiskt EU-underlag och avstämning före fastställande.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"frequency":{"type":"string","enum":["month","quarter"]}},"required":["from","to","frequency"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/vat":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getVatReturns","summary":"Versionssatta momsrapporter, rättelser, avslut och manuellt registrerad inlämning.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageVatReturns","summary":"Versionssatta momsrapporter, rättelser, avslut och manuellt registrerad inlämning.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"assessment"},"period":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["fiscalYearId","from","to"],"additionalProperties":false},"findingId":{"type":"string","pattern":"^[a-f0-9]{64}$"},"evidenceHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","period","findingId","evidenceHash","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"prior_handled"},"period":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["fiscalYearId","from","to"],"additionalProperties":false},"reference":{"type":"string","minLength":3,"maxLength":500},"reason":{"type":"string","minLength":5,"maxLength":2000},"submittedOn":{"default":null,"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["kind","period","reference","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"accounts":{"maxItems":5000,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^(?:[0-9]{4}|TEST-[A-Z0-9]+)$"},"code":{"type":"string"}},"required":["accountCode","code"],"additionalProperties":false}},"claimAccount":{"default":"1650","type":"string","pattern":"^(?:[0-9]{4}|TEST-[A-Z0-9]+)$"},"settlementAccount":{"type":"string","pattern":"^(?:[0-9]{4}|TEST-[A-Z0-9]+)$"},"roundingAccount":{"type":"string","pattern":"^(?:[0-9]{4}|TEST-[A-Z0-9]+)$"}},"required":["accounts","settlementAccount","roundingAccount"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"treatment"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"code":{"type":"string"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","journalId","position","version","code","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"finalize"},"period":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["fiscalYearId","from","to"],"additionalProperties":false},"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"bookingOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"default":"","type":"string","maxLength":2000},"reviewed":{"type":"boolean","const":true},"warningsReviewed":{"type":"boolean"},"information":{"default":"","type":"string","maxLength":300}},"required":["kind","period","hash","bookingOn","reviewed","warningsReviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submitted"},"receiptVersionId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"submittedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":500}},"required":["kind","id","submittedOn","reference"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"submission_revoked"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","id","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/vat/history":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getVatReportHistory","summary":"Sidindelad historik över fastställda momsrapportversioner.","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/vat/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewVatReturn","summary":"Granska perioden och avstämningen innan momsrapport fastställs.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["fiscalYearId","from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/vat/{returnId}/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"returnId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","closing-pdf","xml","xlsx","json","view"]}}],"get":{"operationId":"downloadVatReturn","summary":"Historisk fastställd momsrapport, deklarationsfil eller separat bokföringsutskrift för momsavslutet. Ingen deklaration skickas.","parameters":[],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/calendar":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTaxCalendar","summary":"Bolagets granskade kalenderregler, källhänvisningar och skapade aktiviteter.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageTaxCalendar","summary":"Bolagets granskade kalenderregler, källhänvisningar och skapade aktiviteter.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"enabled":{"type":"boolean"},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"vatDeadline":{"type":"string","enum":["standard","early"]},"annualVatEU":{"type":"boolean"},"vatElectronic":{"type":"boolean"},"incomeReturn":{"type":"boolean"},"incomeElectronic":{"type":"boolean"},"employer":{"type":"boolean"},"employerDeadline":{"type":"string","enum":["standard","large"]},"euSales":{"type":"string","enum":["none","goods","services","mixed","quarter_decision"]},"euElectronic":{"type":"boolean"},"closing":{"type":"string","enum":["none","year_end","annual_report"]},"agmDates":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["fiscalYearId","date"],"additionalProperties":false}},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"basis":{"type":"string","minLength":5,"maxLength":2000},"reviewedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"overrides":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["vat","agi","eu_sales","income","closing"]},"periodEnd":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"paymentDueOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":1000},"reference":{"type":"string","minLength":3,"maxLength":300}},"required":["kind","periodEnd","dueOn","paymentDueOn","reason","reference"],"additionalProperties":false}}},"required":["enabled","startOn","endOn","vatDeadline","annualVatEU","vatElectronic","incomeReturn","incomeElectronic","employer","employerDeadline","euSales","euElectronic","closing","agmDates","assigneeId","basis","reviewedOn","overrides"],"additionalProperties":false},"reassignOpen":{"default":false,"type":"boolean"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean","const":true}},"required":["kind","version","body","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"resync"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean","const":true}},"required":["kind","version","reviewHash","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"resolve"},"activityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"decision":{"type":"string","enum":["adopt","retain"]},"note":{"type":"string","minLength":5,"maxLength":2000},"confirmed":{"type":"boolean","const":true}},"required":["kind","activityId","reviewHash","decision","note","confirmed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"moment"},"activityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"basisHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expectedSequence":{"type":"integer","minimum":0,"maximum":9007199254740991},"moment":{"type":"string","enum":["prepared","signed","filed","paid"]},"action":{"type":"string","enum":["confirmed","revoked"]},"occurredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":3,"maxLength":300},"note":{"type":"string","maxLength":2000}},"required":["kind","activityId","version","basisHash","expectedSequence","moment","action","occurredOn","reference","note"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/annual-closing":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAnnualClosingWorkspace","summary":"Årsbundet arbetsläge och manuella anteckningar för aktiebolagets bokslut och INK2.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAnnualClosingWorkspace","summary":"Årsbundet arbetsläge och manuella anteckningar för aktiebolagets bokslut och INK2.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","const":"save"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"framework":{"type":"string","enum":["undecided","K2","K3"]},"preparation":{"maxItems":7,"type":"array","items":{"type":"string","enum":["bookkeeping","balances","manual_adjustments","prior_result","current_result","payroll_tax","tax_accrual"]}},"notes":{"type":"string","maxLength":10000},"steps":{"minItems":8,"maxItems":8,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["settings","adjustments","calculation","reconciliation","annual_report","agm","formalia","income_tax"]},"status":{"type":"string","enum":["open","in_progress","reviewed"]},"note":{"type":"string","maxLength":4000}},"required":["id","status","note"],"additionalProperties":false}},"reportDraft":{"default":{"registeredOffice":"","business":"","formerName":"","specialCircumstances":"","significantEvents":"","afterYearEvents":"","accountingPrinciples":"","proposedDisposition":"","turnoverVariationComment":"","averageEmployees":"","multiYearFigures":[],"notes":[]},"type":"object","properties":{"registeredOffice":{"type":"string","maxLength":120},"business":{"type":"string","maxLength":6000},"formerName":{"default":"","type":"string","maxLength":240},"specialCircumstances":{"default":"","type":"string","maxLength":6000},"significantEvents":{"type":"string","maxLength":6000},"afterYearEvents":{"type":"string","maxLength":6000},"accountingPrinciples":{"type":"string","maxLength":6000},"proposedDisposition":{"type":"string","maxLength":6000},"turnoverVariationComment":{"default":"","type":"string","maxLength":3000},"averageEmployees":{"default":"","anyOf":[{"type":"string","const":""},{"type":"string","pattern":"^\\d{1,7}(?:\\.\\d{1,2})?$"}]},"multiYearFigures":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"yearLabel":{"type":"string","minLength":1,"maxLength":40},"netSales":{"type":"string","pattern":"^-?\\d{1,14}(?:\\.\\d{1,2})?$"},"resultAfterFinancial":{"type":"string","pattern":"^-?\\d{1,14}(?:\\.\\d{1,2})?$"},"solidity":{"type":"string","pattern":"^-?\\d{1,4}(?:\\.\\d{1,2})?$"}},"required":["id","yearLabel","netSales","resultAfterFinancial","solidity"],"additionalProperties":false}},"notes":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","maxLength":160},"text":{"type":"string","maxLength":10000}},"required":["id","title","text"],"additionalProperties":false}}},"required":["registeredOffice","business","significantEvents","afterYearEvents","accountingPrinciples","proposedDisposition","notes"],"additionalProperties":false},"agmDraft":{"default":{"meetingDate":"","meetingPlace":"","chair":"","minutesKeeper":"","votingList":"","adjuster":"","statementsResolution":"","dispositionResolution":"","dischargeResolution":"","otherResolutions":""},"type":"object","properties":{"meetingDate":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]},"meetingPlace":{"type":"string","maxLength":240},"chair":{"type":"string","maxLength":240},"minutesKeeper":{"type":"string","maxLength":240},"votingList":{"type":"string","maxLength":6000},"adjuster":{"type":"string","maxLength":240},"statementsResolution":{"type":"string","maxLength":4000},"dispositionResolution":{"type":"string","maxLength":4000},"dischargeResolution":{"type":"string","maxLength":4000},"otherResolutions":{"type":"string","maxLength":6000}},"required":["meetingDate","meetingPlace","chair","minutesKeeper","votingList","adjuster","statementsResolution","dispositionResolution","dischargeResolution","otherResolutions"],"additionalProperties":false},"formalityRecord":{"default":{"reportSigners":[],"auditorReportOn":"","certificateSigner":"","certificateRole":"","certificateSignedOn":"","filedOn":"","filingReference":""},"type":"object","properties":{"reportSigners":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","maxLength":160},"role":{"type":"string","enum":["board","ceo","deputy"]},"signedOn":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]}},"required":["id","name","role","signedOn"],"additionalProperties":false}},"auditorReportOn":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]},"certificateSigner":{"type":"string","maxLength":160},"certificateRole":{"type":"string","enum":["","board","ceo","deputy"]},"certificateSignedOn":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]},"filedOn":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]},"filingReference":{"type":"string","maxLength":240}},"required":["reportSigners","auditorReportOn","certificateSigner","certificateRole","certificateSignedOn","filedOn","filingReference"],"additionalProperties":false},"incomeTaxDraft":{"default":{"adjustments":[],"supplementary":[],"bases":[],"checks":[],"consultantAssisted":"undecided","audited":"undecided","otherInformation":false,"completedOn":"","reviewNote":"","sender":{"organizationNumber":"","name":"","address":"","postalCode":"","city":"","contact":"","email":"","phone":""}},"type":"object","properties":{"adjustments":{"maxItems":33,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["financial_write_down","other_non_deductible","group_contribution_given","other_unbooked_cost","composition_gain","dividend","other_non_taxable_income","allocation_fund_standard_income","fund_units_standard_income","group_contribution_received","allocation_fund_uplift","other_unbooked_income","shares_booked_gain","shares_booked_loss","shares_deferred_gain","shares_reversed_deferred_gain","shares_tax_gain","shares_deductible_loss","partnership_booked_income","partnership_surplus","partnership_booked_cost","partnership_deficit","depreciation_plus","depreciation_minus","property_sale_plus","property_sale_minus","forest_deduction","property_reversal","other_adjustment_plus","other_adjustment_minus","prior_deficit","deficit_reduction_amount","deficit_reduction_group"]},"amount":{"anyOf":[{"type":"string","const":""},{"type":"string","pattern":"^\\d{1,14}$"}]}},"required":["id","amount"],"additionalProperties":false}},"supplementary":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["building_depreciation","land_depreciation","residual_depreciation_reversal","shareholder_loans","pension_costs","restricted_deficit"]},"amount":{"anyOf":[{"type":"string","const":""},{"type":"string","pattern":"^\\d{1,14}$"}]}},"required":["id","amount"],"additionalProperties":false}},"bases":{"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["bank_risk_tax","pension_tax_positive","pension_tax_negative","pension_assets_15","foreign_pension_15","pension_assets_30","foreign_capital_30","property_small_house","property_apartments","property_small_house_land","property_apartment_land","property_premises","property_industry","property_hydro","property_wind","renewable_electricity"]},"amount":{"anyOf":[{"type":"string","const":""},{"type":"string","pattern":"^\\d{1,14}$"}]}},"required":["id","amount"],"additionalProperties":false}},"checks":{"maxItems":6,"type":"array","items":{"type":"string","enum":["period","book_result","adjustments","deficits","supplementary","filing"]}},"consultantAssisted":{"type":"string","enum":["undecided","yes","no"]},"audited":{"type":"string","enum":["undecided","yes","no"]},"otherInformation":{"type":"boolean"},"completedOn":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]},"reviewNote":{"type":"string","maxLength":6000},"sender":{"type":"object","properties":{"organizationNumber":{"type":"string","maxLength":20},"name":{"type":"string","maxLength":250},"address":{"type":"string","maxLength":250},"postalCode":{"type":"string","maxLength":20},"city":{"type":"string","maxLength":100},"contact":{"type":"string","maxLength":250},"email":{"anyOf":[{"type":"string","const":""},{"type":"string","maxLength":250,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}]},"phone":{"type":"string","maxLength":50}},"required":["organizationNumber","name","address","postalCode","city","contact","email","phone"],"additionalProperties":false}},"required":["adjustments","supplementary","bases","checks","consultantAssisted","audited","otherInformation","completedOn","reviewNote","sender"],"additionalProperties":false},"reportChecks":{"default":[{"id":"k2_eligibility","status":"open","note":""},{"id":"valuation","status":"open","note":""},{"id":"fixed_assets","status":"open","note":""},{"id":"employees","status":"open","note":""},{"id":"security","status":"open","note":""},{"id":"related","status":"open","note":""},{"id":"equity","status":"open","note":""},{"id":"events","status":"open","note":""},{"id":"audit","status":"open","note":""},{"id":"signatures","status":"open","note":""}],"minItems":10,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["k2_eligibility","valuation","fixed_assets","employees","security","related","equity","events","audit","signatures"]},"status":{"type":"string","enum":["open","reviewed","not_applicable"]},"note":{"type":"string","maxLength":2000}},"required":["id","status","note"],"additionalProperties":false}},"statementMappings":{"default":[],"maxItems":2000,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","pattern":"^(?:\\d{4}|TEST-[A-Z0-9]+)$"},"groupId":{"type":"string","enum":["asset_subscribed_unpaid","asset_intangible","asset_tangible","asset_financial","asset_inventory","asset_receivables","asset_investments","asset_cash","capital_equity","capital_untaxed","capital_provisions","capital_long_debt","capital_short_debt","result_sales","result_inventory","result_own_work","result_other_income","result_material","result_merchandise","result_external","result_staff","result_depreciation","result_write_down","result_other_cost","result_financial","result_appropriations","result_tax","result_transfer"]},"lineId":{"type":"string","enum":["a_unpaid","a_i_rights","a_i_lease","a_i_goodwill","a_i_other","a_i_advance","a_t_buildings","a_t_machines","a_t_equipment","a_t_improvements","a_t_other","a_t_advance","a_f_group_shares","a_f_group_receivables","a_f_associate_shares","a_f_associate_receivables","a_f_other_interests","a_f_other_interest_receivables","a_f_securities","a_f_owner_loans","a_f_other_receivables","a_v_raw","a_v_work","a_v_finished","a_v_merchandise","a_v_other","a_v_contract","a_v_advance","a_r_trade","a_r_group","a_r_associates","a_r_other_interests","a_r_other","a_r_unbilled","a_r_prepaid","a_p_group","a_p_other","a_c_cash","a_c_client","e_share_capital","e_unregistered","e_bound_premium","e_revaluation","e_reserve","e_free_premium","e_retained","e_year_result","u_tax_allocation","u_depreciation","u_other","p_secured_pension","p_other_pension","p_other","l_bonds","l_credit","l_banks","l_group","l_associates","l_other_interests","l_other","s_credit","s_banks","s_customer_advance","s_contract","s_deferred_revenue","s_trade","s_bills","s_group","s_associates","s_other_interests","s_tax","s_other","s_accrued","r_sales","r_stock","r_own_work","r_other_income","r_raw","r_merchandise","r_external","r_staff","r_depreciation","r_write_down","r_other_cost","r_group_shares","r_associate_shares","r_other_interests","r_financial_assets","r_interest_income","r_financial_write_down","r_interest_cost","r_group_contribution_received","r_group_contribution_given","r_tax_allocation","r_overdepreciation","r_other_appropriations","r_income_tax","r_other_tax"]}},"required":["code","groupId"],"additionalProperties":false}},"statementSplits":{"default":[],"maxItems":2000,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","pattern":"^(?:\\d{4}|TEST-[A-Z0-9]+)$"},"portions":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","enum":["a_unpaid","a_i_rights","a_i_lease","a_i_goodwill","a_i_other","a_i_advance","a_t_buildings","a_t_machines","a_t_equipment","a_t_improvements","a_t_other","a_t_advance","a_f_group_shares","a_f_group_receivables","a_f_associate_shares","a_f_associate_receivables","a_f_other_interests","a_f_other_interest_receivables","a_f_securities","a_f_owner_loans","a_f_other_receivables","a_v_raw","a_v_work","a_v_finished","a_v_merchandise","a_v_other","a_v_contract","a_v_advance","a_r_trade","a_r_group","a_r_associates","a_r_other_interests","a_r_other","a_r_unbilled","a_r_prepaid","a_p_group","a_p_other","a_c_cash","a_c_client","e_share_capital","e_unregistered","e_bound_premium","e_revaluation","e_reserve","e_free_premium","e_retained","e_year_result","u_tax_allocation","u_depreciation","u_other","p_secured_pension","p_other_pension","p_other","l_bonds","l_credit","l_banks","l_group","l_associates","l_other_interests","l_other","s_credit","s_banks","s_customer_advance","s_contract","s_deferred_revenue","s_trade","s_bills","s_group","s_associates","s_other_interests","s_tax","s_other","s_accrued","r_sales","r_stock","r_own_work","r_other_income","r_raw","r_merchandise","r_external","r_staff","r_depreciation","r_write_down","r_other_cost","r_group_shares","r_associate_shares","r_other_interests","r_financial_assets","r_interest_income","r_financial_write_down","r_interest_cost","r_group_contribution_received","r_group_contribution_given","r_tax_allocation","r_overdepreciation","r_other_appropriations","r_income_tax","r_other_tax"]},"rawAmount":{"type":"string","pattern":"^-?\\d{1,14}(?:\\.\\d{1,2})?$"}},"required":["lineId","rawAmount"],"additionalProperties":false}}},"required":["code","portions"],"additionalProperties":false}}},"required":["framework","preparation","notes","steps"],"additionalProperties":false}},"required":["kind","fiscalYearId","version","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/annual-closing/draft":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadAnnualClosingReviewDraft","summary":"Hämta ett tydligt märkt granskningsutkast för årsredovisningen.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/annual-closing/agm-draft":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadAnnualAgmMinutesDraft","summary":"Hämta ett tydligt märkt protokollutkast utan besluts- eller underskriftsintyg.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/annual-closing/signature":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadAnnualReportForSignature","summary":"Hämta den slutkontrollerade K2-årsredovisningen för underskrift. Hämtningen stoppas om underlaget inte är komplett.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/annual-closing/income-tax-review":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadIncomeTaxReview","summary":"Hämta ett tydligt märkt INK2-granskningsunderlag. Dokumentet är inte en originalblankett och skickas inte.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/annual-closing/income-tax-sru":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadIncomeTaxSru","summary":"Hämta ett lokalt SRU-paket med INFO.SRU och BLANKETTER.SRU. Hämtningen stoppas om underlag eller blankettversion inte är klara.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/calendar/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewTaxCalendar","summary":"Granska kalenderutfallet med underlag för varje datum.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"object","properties":{"enabled":{"type":"boolean"},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"effectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"vatDeadline":{"type":"string","enum":["standard","early"]},"annualVatEU":{"type":"boolean"},"vatElectronic":{"type":"boolean"},"incomeReturn":{"type":"boolean"},"incomeElectronic":{"type":"boolean"},"employer":{"type":"boolean"},"employerDeadline":{"type":"string","enum":["standard","large"]},"euSales":{"type":"string","enum":["none","goods","services","mixed","quarter_decision"]},"euElectronic":{"type":"boolean"},"closing":{"type":"string","enum":["none","year_end","annual_report"]},"agmDates":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["fiscalYearId","date"],"additionalProperties":false}},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"basis":{"type":"string","minLength":5,"maxLength":2000},"reviewedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"overrides":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["vat","agi","eu_sales","income","closing"]},"periodEnd":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"paymentDueOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":1000},"reference":{"type":"string","minLength":3,"maxLength":300}},"required":["kind","periodEnd","dueOn","paymentDueOn","reason","reference"],"additionalProperties":false}}},"required":["enabled","startOn","endOn","vatDeadline","annualVatEU","vatElectronic","incomeReturn","incomeElectronic","employer","employerDeadline","euSales","euElectronic","closing","agmDates","assigneeId","basis","reviewedOn","overrides"],"additionalProperties":false},"reassignOpen":{"default":false,"type":"boolean"}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/contracts":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getClientContracts","summary":"Interna avtalsutkast, bevarade dokumentversioner, explicit delning och underskriftsbevis. Uppdrag och kundpriser överförs separat efter versionsbunden granskning.","parameters":[{"name":"history","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageClientContracts","summary":"Interna avtalsutkast, bevarade dokumentversioner, explicit delning och underskriftsbevis. Uppdrag och kundpriser överförs separat efter versionsbunden granskning.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"draft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"templateVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"agencyVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"parentId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"replacesId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"title":{"default":"Uppdragsavtal","type":"string","maxLength":180},"date":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"scope":{"default":"","type":"string","maxLength":2000},"fee":{"default":"","type":"string","maxLength":2000},"recipientEmail":{"default":"","type":"string","maxLength":254},"text":{"default":"","type":"string","maxLength":40000},"reviewed":{"default":false,"type":"boolean"},"period":{"type":"object","properties":{"startsOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"endsOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["startsOn","endsOn"],"additionalProperties":false},"services":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","maxLength":160},"category":{"type":"string","enum":["bookkeeping","payroll","vat","customers","suppliers","eu_sales","accounting","closing","annual_report","tax","custom"]},"interval":{"type":"string","enum":["weekly","monthly","quarterly","semiannual","yearly","once"]},"agencyResponsibility":{"type":"string","maxLength":2000},"clientResponsibility":{"type":"string","maxLength":2000}},"required":["id","serviceId","name","category","interval","agencyResponsibility","clientResponsibility"],"additionalProperties":false}},"prices":{"anyOf":[{"type":"object","properties":{"fixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"activeOnly":{"type":"boolean"},"fixedKind":{"default":"program","type":"string","enum":["program","bundle"]},"programAllocation":{"anyOf":[{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},{"type":"null"}]},"serviceFixed":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"modules":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"module":{"type":"string","enum":["bookkeeping","supplier","customer","payroll","documents"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"when":{"type":"string","enum":["enabled","used"]},"enabled":{"type":"boolean"}},"required":["module","price","when"],"additionalProperties":false}},"variables":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["journals","supplierInvoices","paymentOrders","customerInvoices","customerSent","reminders","payslips","employeesPaid","documents","interpretedDocuments","pages","receipts","clientUsers"]},"price":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"included":{"type":"integer","minimum":0,"maximum":100000000},"includedAll":{"type":"boolean"}},"required":["metric","price"],"additionalProperties":false}},"note":{"type":"string","maxLength":1000}},"required":["fixed","activeOnly","variables","note"],"additionalProperties":false},{"type":"null"}]},"priceAppendix":{"type":"string","maxLength":2000},"attachments":{"maxItems":40,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"sourceFileId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"textMode":{"type":"string","enum":["generated","manual"]},"textBasis":{"type":"string","maxLength":40000},"refreshParties":{"type":"boolean"},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"followUpOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"apply-services"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"effectiveOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","effectiveOn","through","reviewHash","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"apply-prices"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"effectiveOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","effectiveOn","reviewHash","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"finalize"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"status"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"state":{"type":"string","enum":["sent","signed","terminated"]},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":5,"maxLength":2000},"reviewed":{"type":"boolean","const":true},"signedFileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"signatures":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":180},"party":{"type":"string","enum":["agency","client"]},"signedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"capacity":{"type":"string","maxLength":300}},"required":["name","party","signedOn","capacity"],"additionalProperties":false}},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","id","version","state","date","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"share"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fileIds":{"minItems":1,"maxItems":45,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"recipientIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","fileIds","recipientIds","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"followup"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"followUpOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["kind","id","version","ownerId","followUpOn"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"mail"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","reviewed"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/contracts/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"previewContractTransfer","summary":"Jämför uppdrag eller kundpriser utan att ändra dem.","parameters":[{"name":"id","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"version","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"target","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["services","prices"]}},{"name":"effectiveOn","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"through","in":"query","required":false,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/kyc":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getClientKyc","summary":"Behörig kundkännedom, riskbedömning, dokumentlänkar och granskningar.","parameters":[{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageClientKyc","summary":"Behörig kundkännedom, riskbedömning, dokumentlänkar och granskningar.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"people":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":300},"nationalId":{"type":"string","maxLength":300},"role":{"type":"string","maxLength":300},"share":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,6})?$"},{"type":"null"}]},"controlBasis":{"type":"string","maxLength":8000},"identityBasis":{"type":"string","maxLength":8000},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["representative","beneficial_owner","other"]}}},"required":["name","nationalId","role","share","controlBasis","identityBasis","id","roles"],"additionalProperties":false}},"checks":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"personId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"kind":{"type":"string","enum":["identity","pep","sanctions"]},"status":{"type":"string","enum":["unknown","clear","possible","confirmed","dismissed","error"]},"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","maxLength":300},"checkedBy":{"type":"string","maxLength":300},"reference":{"type":"string","maxLength":300},"resolution":{"type":"string","maxLength":8000},"documentIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","personId","kind","status","checkedOn","source","checkedBy","reference","resolution","documentIds"],"additionalProperties":false}},"workflow":{"type":"string","enum":["in_progress","waiting","ready"]},"reviewReason":{"type":"string","maxLength":8000},"reviewIntervalMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"reviewDateReason":{"type":"string","maxLength":8000},"generalRisk":{"anyOf":[{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","maxLength":300},"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["versionId","name","number"]},{"type":"null"}]},"sourceContext":{"anyOf":[{"type":"object","properties":{"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"summary":{"type":"string","maxLength":8000},"confirmedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["hash","summary","confirmedOn"]},{"type":"null"}]},"customerThreadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"risk":{"type":"string","enum":["","low","normal","high"]},"riskReason":{"type":"string","maxLength":8000},"purpose":{"type":"string","maxLength":8000},"nature":{"type":"string","maxLength":8000},"expectedActivity":{"type":"string","maxLength":8000},"countries":{"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"highRiskCountry":{"type":"boolean"},"fundsRelevant":{"type":"boolean"},"sourceOfFunds":{"type":"string","maxLength":8000},"enhancedMeasures":{"type":"string","maxLength":8000},"decisionMaker":{"type":"string","maxLength":300},"responsibleId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assessedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"nextReviewOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"identity":{"type":"object","properties":{"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"method":{"type":"string","maxLength":300},"basis":{"type":"string","maxLength":8000},"documentIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["checkedOn","method","basis","documentIds"],"additionalProperties":false},"ownership":{"type":"object","properties":{"type":{"type":"string","enum":["unknown","identified","alternative","exempt","natural_person"]},"registerCheckedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"basis":{"type":"string","maxLength":8000},"people":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":300},"nationalId":{"type":"string","maxLength":300},"role":{"type":"string","maxLength":300},"share":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,6})?$"},{"type":"null"}]},"controlBasis":{"type":"string","maxLength":8000},"identityBasis":{"type":"string","maxLength":8000}},"required":["name","nationalId","role","share","controlBasis","identityBasis"],"additionalProperties":false}}},"required":["type","registerCheckedOn","basis","people"],"additionalProperties":false},"representatives":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":300},"nationalId":{"type":"string","maxLength":300},"role":{"type":"string","maxLength":300},"share":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,6})?$"},{"type":"null"}]},"controlBasis":{"type":"string","maxLength":8000},"identityBasis":{"type":"string","maxLength":8000}},"required":["name","nationalId","role","share","controlBasis","identityBasis"],"additionalProperties":false}},"pep":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","clear","match","review"]},"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","maxLength":300},"reference":{"type":"string","maxLength":300},"provider":{"type":"string","maxLength":300},"checkedBy":{"type":"string","maxLength":300}},"required":["status","checkedOn","source","reference","provider","checkedBy"],"additionalProperties":false},"sanctions":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","clear","match","review"]},"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","maxLength":300},"reference":{"type":"string","maxLength":300},"provider":{"type":"string","maxLength":300},"checkedBy":{"type":"string","maxLength":300}},"required":["status","checkedOn","source","reference","provider","checkedBy"],"additionalProperties":false},"note":{"type":"string","maxLength":8000}},"required":["risk","riskReason","purpose","nature","expectedActivity","countries","highRiskCountry","fundsRelevant","sourceOfFunds","enhancedMeasures","decisionMaker","responsibleId","assessedOn","nextReviewOn","identity","ownership","representatives","pep","sanctions","note"],"additionalProperties":false},"approve":{"type":"boolean"},"reviewed":{"type":"boolean"},"reason":{"default":"","type":"string","maxLength":4000}},"required":["version","body","approve","reviewed"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/kyc/review":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"reviewClientKyc","summary":"Granska kompletteringsbehov utan att ändra bedömningen.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"people":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":300},"nationalId":{"type":"string","maxLength":300},"role":{"type":"string","maxLength":300},"share":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,6})?$"},{"type":"null"}]},"controlBasis":{"type":"string","maxLength":8000},"identityBasis":{"type":"string","maxLength":8000},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["representative","beneficial_owner","other"]}}},"required":["name","nationalId","role","share","controlBasis","identityBasis","id","roles"],"additionalProperties":false}},"checks":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"personId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"kind":{"type":"string","enum":["identity","pep","sanctions"]},"status":{"type":"string","enum":["unknown","clear","possible","confirmed","dismissed","error"]},"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","maxLength":300},"checkedBy":{"type":"string","maxLength":300},"reference":{"type":"string","maxLength":300},"resolution":{"type":"string","maxLength":8000},"documentIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","personId","kind","status","checkedOn","source","checkedBy","reference","resolution","documentIds"],"additionalProperties":false}},"workflow":{"type":"string","enum":["in_progress","waiting","ready"]},"reviewReason":{"type":"string","maxLength":8000},"reviewIntervalMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"reviewDateReason":{"type":"string","maxLength":8000},"generalRisk":{"anyOf":[{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","maxLength":300},"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["versionId","name","number"]},{"type":"null"}]},"sourceContext":{"anyOf":[{"type":"object","properties":{"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"summary":{"type":"string","maxLength":8000},"confirmedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["hash","summary","confirmedOn"]},{"type":"null"}]},"customerThreadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"risk":{"type":"string","enum":["","low","normal","high"]},"riskReason":{"type":"string","maxLength":8000},"purpose":{"type":"string","maxLength":8000},"nature":{"type":"string","maxLength":8000},"expectedActivity":{"type":"string","maxLength":8000},"countries":{"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"highRiskCountry":{"type":"boolean"},"fundsRelevant":{"type":"boolean"},"sourceOfFunds":{"type":"string","maxLength":8000},"enhancedMeasures":{"type":"string","maxLength":8000},"decisionMaker":{"type":"string","maxLength":300},"responsibleId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assessedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"nextReviewOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"identity":{"type":"object","properties":{"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"method":{"type":"string","maxLength":300},"basis":{"type":"string","maxLength":8000},"documentIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["checkedOn","method","basis","documentIds"],"additionalProperties":false},"ownership":{"type":"object","properties":{"type":{"type":"string","enum":["unknown","identified","alternative","exempt","natural_person"]},"registerCheckedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"basis":{"type":"string","maxLength":8000},"people":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":300},"nationalId":{"type":"string","maxLength":300},"role":{"type":"string","maxLength":300},"share":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,6})?$"},{"type":"null"}]},"controlBasis":{"type":"string","maxLength":8000},"identityBasis":{"type":"string","maxLength":8000}},"required":["name","nationalId","role","share","controlBasis","identityBasis"],"additionalProperties":false}}},"required":["type","registerCheckedOn","basis","people"],"additionalProperties":false},"representatives":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":300},"nationalId":{"type":"string","maxLength":300},"role":{"type":"string","maxLength":300},"share":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,6})?$"},{"type":"null"}]},"controlBasis":{"type":"string","maxLength":8000},"identityBasis":{"type":"string","maxLength":8000}},"required":["name","nationalId","role","share","controlBasis","identityBasis"],"additionalProperties":false}},"pep":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","clear","match","review"]},"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","maxLength":300},"reference":{"type":"string","maxLength":300},"provider":{"type":"string","maxLength":300},"checkedBy":{"type":"string","maxLength":300}},"required":["status","checkedOn","source","reference","provider","checkedBy"],"additionalProperties":false},"sanctions":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","clear","match","review"]},"checkedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"source":{"type":"string","maxLength":300},"reference":{"type":"string","maxLength":300},"provider":{"type":"string","maxLength":300},"checkedBy":{"type":"string","maxLength":300}},"required":["status","checkedOn","source","reference","provider","checkedBy"],"additionalProperties":false},"note":{"type":"string","maxLength":8000}},"required":["risk","riskReason","purpose","nature","expectedActivity","countries","highRiskCountry","fundsRelevant","sourceOfFunds","enhancedMeasures","decisionMaker","responsibleId","assessedOn","nextReviewOn","identity","ownership","representatives","pep","sanctions","note"],"additionalProperties":false},"approve":{"type":"boolean"},"reviewed":{"type":"boolean"},"reason":{"default":"","type":"string","maxLength":4000}},"required":["version","body","approve","reviewed"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/kyc-worklist":{"get":{"operationId":"getKycWorklist","summary":"Sidindelad arbetslista för behöriga klienter.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/kyc-routine":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyKycRoutine","summary":"Byråns versionsbundna riskdokument och valda omprövningsintervall.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAgencyKycRoutine","summary":"Byråns versionsbundna riskdokument och valda omprövningsintervall.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"documentVersionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"months":{"type":"object","properties":{"low":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"normal":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"high":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]}},"required":["low","normal","high"],"additionalProperties":false}},"required":["version","documentVersionId","months"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/calendar/export/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","xlsx"]}}],"get":{"operationId":"exportTaxCalendar","summary":"Filtrerad behörig calendar-export.","parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string"}},{"name":"year","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/contracts/export/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","xlsx"]}}],"get":{"operationId":"exportClientContracts","summary":"Filtrerad behörig contracts-export.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"validity","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/kyc/export/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","xlsx"]}}],"get":{"operationId":"exportClientKyc","summary":"Filtrerad behörig kyc-export.","parameters":[{"name":"version","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/retention":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getArchiveRetention","summary":"Klassvisa arkivbeslut, verifierade paket, mottagarkvittenser och bevarandespärrar. Gallring utförs separat av underhållsrollen.","parameters":[{"name":"receipt","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageArchiveRetention","summary":"Klassvisa arkivbeslut, verifierade paket, mottagarkvittenser och bevarandespärrar. Gallring utförs separat av underhållsrollen.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"policy"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":2000},"notice":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"recipient":{"type":"string","minLength":5,"maxLength":2000},"earliestPurge":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":5,"maxLength":2000}},"required":["date","recipient","earliestPurge","reference"],"additionalProperties":false},{"type":"null"}]},"kycExtension":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"kycExtensionReason":{"type":"string","maxLength":2000},"classes":{"minItems":6,"maxItems":6,"type":"array","items":{"type":"object","properties":{"classification":{"type":"string","enum":["accounting","kyc","personnel","contacts","operations","communication"]},"purpose":{"type":"string","minLength":5,"maxLength":2000},"through":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"decision":{"type":"string","enum":["keep","expired_delete","handover_delete"]},"legalReference":{"type":"string","minLength":5,"maxLength":2000}},"required":["classification","purpose","through","decision","legalReference"],"additionalProperties":false}}},"required":["reason","notice","kycExtension","kycExtensionReason","classes"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["kind","version","body","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"hold"},"classification":{"type":"string","enum":["all","accounting","kyc","personnel","contacts","operations","communication"]},"reason":{"type":"string","minLength":5,"maxLength":2000},"reference":{"type":"string","minLength":5,"maxLength":2000},"placedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","classification","reason","reference","placedOn"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"releaseHold"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"releasedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reference":{"type":"string","minLength":5,"maxLength":2000},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","releasedOn","reference","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"verifyPackage"},"base64":{"type":"string","minLength":1,"maxLength":280000000},"reviewed":{"type":"boolean","const":true}},"required":["kind","base64","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"receipt"},"packageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"object","properties":{"receivedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"recipient":{"type":"string","minLength":5,"maxLength":2000},"recipientRole":{"type":"string","enum":["agency","archive_provider"]},"mandate":{"type":"string","minLength":5,"maxLength":2000},"writtenReceipt":{"type":"string","minLength":5,"maxLength":2000},"storageLocation":{"type":"string","minLength":5,"maxLength":2000},"readingInstructions":{"type":"string","minLength":5,"maxLength":2000},"legalReview":{"type":"string","minLength":5,"maxLength":2000},"classes":{"minItems":6,"maxItems":6,"type":"array","items":{"type":"string","enum":["accounting","kyc","personnel","contacts","operations","communication"]}},"confirmed":{"type":"boolean","const":true}},"required":["receivedOn","recipient","recipientRole","mandate","writtenReceipt","storageLocation","readingInstructions","legalReview","classes","confirmed"],"additionalProperties":false}},"required":["kind","packageId","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"withdrawReceipt"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":5,"maxLength":2000},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"classify"},"subjectType":{"type":"string","enum":["message","question","email","document"]},"subjectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","subjectType","subjectId","fiscalYearId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"queuePurge"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"organizationNumber":{"type":"string","minLength":1},"decisionReference":{"type":"string","minLength":5,"maxLength":2000},"legalReview":{"type":"string","minLength":5,"maxLength":2000},"reviewed":{"type":"boolean","const":true}},"required":["kind","reviewHash","organizationNumber","decisionReference","legalReview","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"cancelPurge"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":5,"maxLength":2000}},"required":["kind","id","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/storage":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getStorageUsage","summary":"Aktuell fillagring och avtalad kvot för valt bolag.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/bank-connections":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getBankConnections","summary":"Syntetiskt prov av samtycke, synkning, förnyelse och bortkoppling. Verklig PSD2-partner är inte ansluten.","parameters":[],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageBankConnections","summary":"Syntetiskt prov av samtycke, synkning, förnyelse och bortkoppling. Verklig PSD2-partner är inte ansluten.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","const":"synthetic"},"institution":{"type":"string","const":"synthetic-bank"},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","accountId","provider","institution","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"consent"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"accepted":{"type":"boolean"},"automatic":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","accepted","automatic","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"renew"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"sync"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"automatic"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","enabled","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"disconnect"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":5,"maxLength":500},"reviewed":{"type":"boolean","const":true}},"required":["kind","id","version","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"retry"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/assets/report":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"readAssetReport","summary":"Historiskt anläggningsregister med samma datum, namn, grupp, status och dimensionsurval i alla format.","parameters":[{"name":"asOf","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"group","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["all","active","disposed","fully_depreciated","automatic","void"]}},{"name":"dimensionId","in":"query","required":false,"schema":{"type":"string"}},{"name":"objectCode","in":"query","required":false,"schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx","json"]}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/assets":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getFixedAssets","summary":"Tillgångar, versioner av avskrivningsplan, bokföring och spårbara återföringar.","parameters":[{"name":"asOf","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"sourceInvoice","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["workspace","reconciliation","template","source-links","purchase-sources"]}},{"name":"journal","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"selectedId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"sourceJournal","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"group","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx"]}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageFixedAssets","summary":"Tillgångar, versioner av avskrivningsplan, bokföring och spårbara återföringar.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["preview-import","preview-action","parse-import","map-import"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"import"},"file":{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"body":{"type":"object","properties":{"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}},"name":{"type":"string","minLength":2,"maxLength":160},"group":{"type":"string","maxLength":160},"acquiredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"cost":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDepreciation":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"sourceJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"sourceKey":{"type":"string","minLength":3,"maxLength":200},"basis":{"type":"string","enum":["journal","opening"]},"reference":{"type":"string","minLength":5,"maxLength":1500},"assetAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"accumulatedAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"expenseAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"gainAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"lossAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"}},"required":["name","group","acquiredOn","cost","openingDepreciation","openingDate","sourceJournalId","sourcePosition","sourceKey","basis","reference","assetAccount","accumulatedAccount","expenseAccount","gainAccount","lossAccount","series"],"additionalProperties":false},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"automatic":{"type":"boolean"}},"required":["body","plan","automatic"],"additionalProperties":false}},"fileName":{"type":"string","minLength":1,"maxLength":200}},"required":["items","fileName"],"additionalProperties":false},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reviewed":{"type":"boolean","const":true}},"required":["kind","file","previewHash","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"create"},"body":{"type":"object","properties":{"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}},"name":{"type":"string","minLength":2,"maxLength":160},"group":{"type":"string","maxLength":160},"acquiredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"cost":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDepreciation":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"sourceJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"sourceKey":{"type":"string","minLength":3,"maxLength":200},"basis":{"type":"string","enum":["journal","opening"]},"reference":{"type":"string","minLength":5,"maxLength":1500},"assetAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"accumulatedAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"expenseAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"gainAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"lossAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"}},"required":["name","group","acquiredOn","cost","openingDepreciation","openingDate","sourceJournalId","sourcePosition","sourceKey","basis","reference","assetAccount","accumulatedAccount","expenseAccount","gainAccount","lossAccount","series"],"additionalProperties":false},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"automatic":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","body","plan","automatic","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"book"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","through","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"revise"},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","plan","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"automatic"},"enabled":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","enabled","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"dispose"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"method":{"type":"string","enum":["scrap","sale"]},"saleJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"salePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","date","method","saleJournalId","salePosition","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"reverse"},"postingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","postingId","date","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"void"},"reason":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","reason","reviewed"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"type":"string","const":"book-batch"},"selected":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","selected","through"],"additionalProperties":false}]},{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"draft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"discard-draft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"source-decision"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"version":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"state":{"type":"string","enum":["deferred","dismissed"]},"reason":{"type":"string","minLength":5,"maxLength":1500},"followUp":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["kind","journalId","position","version","state","reason","followUp"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"type":"string","const":"reviewed-action"},"action":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"import"},"file":{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"body":{"type":"object","properties":{"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}},"name":{"type":"string","minLength":2,"maxLength":160},"group":{"type":"string","maxLength":160},"acquiredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"cost":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDepreciation":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"sourceJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"sourceKey":{"type":"string","minLength":3,"maxLength":200},"basis":{"type":"string","enum":["journal","opening"]},"reference":{"type":"string","minLength":5,"maxLength":1500},"assetAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"accumulatedAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"expenseAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"gainAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"lossAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"}},"required":["name","group","acquiredOn","cost","openingDepreciation","openingDate","sourceJournalId","sourcePosition","sourceKey","basis","reference","assetAccount","accumulatedAccount","expenseAccount","gainAccount","lossAccount","series"],"additionalProperties":false},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"automatic":{"type":"boolean"}},"required":["body","plan","automatic"],"additionalProperties":false}},"fileName":{"type":"string","minLength":1,"maxLength":200}},"required":["items","fileName"],"additionalProperties":false},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reviewed":{"type":"boolean","const":true}},"required":["kind","file","previewHash","reviewed"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"create"},"body":{"type":"object","properties":{"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}},"name":{"type":"string","minLength":2,"maxLength":160},"group":{"type":"string","maxLength":160},"acquiredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"cost":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDepreciation":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"sourceJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"sourceKey":{"type":"string","minLength":3,"maxLength":200},"basis":{"type":"string","enum":["journal","opening"]},"reference":{"type":"string","minLength":5,"maxLength":1500},"assetAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"accumulatedAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"expenseAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"gainAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"lossAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"}},"required":["name","group","acquiredOn","cost","openingDepreciation","openingDate","sourceJournalId","sourcePosition","sourceKey","basis","reference","assetAccount","accumulatedAccount","expenseAccount","gainAccount","lossAccount","series"],"additionalProperties":false},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"automatic":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["kind","body","plan","automatic","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"book"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","through","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"revise"},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","plan","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"automatic"},"enabled":{"type":"boolean"},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","enabled","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"dispose"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"method":{"type":"string","enum":["scrap","sale"]},"saleJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"salePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","date","method","saleJournalId","salePosition","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"reverse"},"postingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reason":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","postingId","date","reason","reviewed"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","const":"void"},"reason":{"type":"string","minLength":5,"maxLength":1500},"reviewed":{"type":"boolean","const":true}},"required":["id","version","kind","reason","reviewed"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"type":"string","const":"book-batch"},"selected":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","selected","through"],"additionalProperties":false}]},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"draft":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","version"]}},"required":["kind","action","previewHash"],"additionalProperties":false},{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"body":{"type":"object","properties":{"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}},"name":{"type":"string","minLength":2,"maxLength":160},"group":{"type":"string","maxLength":160},"acquiredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"cost":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDepreciation":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"openingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"sourceJournalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePosition":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"sourceKey":{"type":"string","minLength":3,"maxLength":200},"basis":{"type":"string","enum":["journal","opening"]},"reference":{"type":"string","minLength":5,"maxLength":1500},"assetAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"accumulatedAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"expenseAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"gainAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"lossAccount":{"type":"string","pattern":"^(\\d{4}|TEST-[A-Z0-9]+)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"}},"required":["name","group","acquiredOn","cost","openingDepreciation","openingDate","sourceJournalId","sourcePosition","sourceKey","basis","reference","assetAccount","accumulatedAccount","expenseAccount","gainAccount","lossAccount","series"],"additionalProperties":false},"plan":{"type":"object","properties":{"firstMonth":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"months":{"type":"integer","minimum":1,"maximum":1200},"residual":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"reason":{"type":"string","minLength":5,"maxLength":1500}},"required":["firstMonth","months","residual","reason"],"additionalProperties":false},"automatic":{"type":"boolean"}},"required":["body","plan","automatic"],"additionalProperties":false}},"fileName":{"type":"string","minLength":1,"maxLength":200}},"required":["items","fileName"],"additionalProperties":false},{"type":"object","properties":{"fileName":{"type":"string","maxLength":200},"format":{"type":"string","enum":["xlsx","csv"]},"base64":{"type":"string","maxLength":3145728},"delimiter":{"type":"string","enum":[";",",","\t"]}},"required":["fileName","format","base64"],"additionalProperties":false},{"type":"object","properties":{"fileName":{"type":"string","maxLength":200},"openingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"rows":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"values":{"maxItems":60,"type":"array","items":{"type":"string","maxLength":1000}}},"required":["row","values"]}},"columns":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":59}}},"required":["fileName","openingDate","rows","columns"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/library":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyLibrary","summary":"Dokumentbibliotek med ärvda mapp- och dataklassrättigheter.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"space","in":"query","required":false,"schema":{"type":"string","enum":["agency","internal","shared"]}},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["common","people","all"]}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","updated"]}},{"name":"periodFrom","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"periodTo","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"includeChildren","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"documentId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageAgencyLibrary","summary":"Dokumentbibliotek med ärvda mapp- och dataklassrättigheter.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"folder"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":180},"space":{"type":"string","enum":["agency","internal","shared"]},"classification":{"type":"string","enum":["general","kyc","person","payroll"]},"acl":{"type":"object","properties":{"roles":{"maxItems":4,"type":"array","items":{"type":"string","enum":["admin","accountant","viewer","auditor"]}},"users":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["roles","users"],"additionalProperties":false}},"required":["kind","version","parentId","name","space","classification","acl"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"item"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":180},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":1000},"sharing":{"type":"object","properties":{"memberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fileIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["memberIds","fileIds"],"additionalProperties":false}},"required":["kind","id","version","name","folderId","archived","reason"],"additionalProperties":false}]},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"shareVersion"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":180},"reason":{"type":"string","minLength":3,"maxLength":1000},"sharing":{"type":"object","properties":{"memberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fileIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["memberIds","fileIds"],"additionalProperties":false}},"required":["kind","id","version","fileId","folderId","name","reason","sharing"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"metadata"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},"required":["kind","id","version","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"forwardReceipt"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purpose":{"type":"string","enum":["receipt","supplier"]}},"required":["kind","fileId","purpose"],"additionalProperties":false}]}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/library/files/{id}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadAgencyDocument","summary":"Hämta behörigt original med kontroll av aktuell åtkomst.","parameters":[],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/library/export/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","xlsx","zip"]}}],"get":{"operationId":"exportAgencyLibrary","summary":"PDF-/Excel-lista eller ZIP med behöriga original, senaste version som standard.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"space","in":"query","required":false,"schema":{"type":"string","enum":["agency","internal","shared"]}},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["common","people","all"]}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","updated"]}},{"name":"periodFrom","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"periodTo","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"includeChildren","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"documentId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000}},{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"allVersions","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"completeFolder","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/library/upload":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"uploadAgencyDocument","summary":"Original upp till 20 MB. Metadata är JSON-kodad text enligt angivet schema.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","metadata"],"properties":{"file":{"type":"string","format":"binary"},"metadata":{"type":"string","contentMediaType":"application/json","contentSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":180}},"name":{"type":"string","minLength":1,"maxLength":180},"itemId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"version":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["folderId","path","name"],"additionalProperties":false}}}}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"201":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/library":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCompanyLibrary","summary":"Dokumentbibliotek med ärvda mapp- och dataklassrättigheter.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"space","in":"query","required":false,"schema":{"type":"string","enum":["agency","internal","shared"]}},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["common","people","all"]}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","updated"]}},{"name":"periodFrom","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"periodTo","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"includeChildren","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"documentId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000}}],"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}},"post":{"operationId":"manageCompanyLibrary","summary":"Dokumentbibliotek med ärvda mapp- och dataklassrättigheter.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"folder"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":180},"space":{"type":"string","enum":["agency","internal","shared"]},"classification":{"type":"string","enum":["general","kyc","person","payroll"]},"acl":{"type":"object","properties":{"roles":{"maxItems":4,"type":"array","items":{"type":"string","enum":["admin","accountant","viewer","auditor"]}},"users":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["roles","users"],"additionalProperties":false}},"required":["kind","version","parentId","name","space","classification","acl"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"item"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":180},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":1000},"sharing":{"type":"object","properties":{"memberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fileIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["memberIds","fileIds"],"additionalProperties":false}},"required":["kind","id","version","name","folderId","archived","reason"],"additionalProperties":false}]},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"shareVersion"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":180},"reason":{"type":"string","minLength":3,"maxLength":1000},"sharing":{"type":"object","properties":{"memberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fileIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["memberIds","fileIds"],"additionalProperties":false}},"required":["kind","id","version","fileId","folderId","name","reason","sharing"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"metadata"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},"required":["kind","id","version","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"forwardReceipt"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purpose":{"type":"string","enum":["receipt","supplier"]}},"required":["kind","fileId","purpose"],"additionalProperties":false}]}]}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/library/files/{id}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadCompanyDocument","summary":"Hämta behörigt original med kontroll av aktuell åtkomst.","parameters":[],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/library/export/{format}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["pdf","xlsx","zip"]}}],"get":{"operationId":"exportCompanyLibrary","summary":"PDF-/Excel-lista eller ZIP med behöriga original, senaste version som standard.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"space","in":"query","required":false,"schema":{"type":"string","enum":["agency","internal","shared"]}},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["common","people","all"]}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","updated"]}},{"name":"periodFrom","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"periodTo","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"includeChildren","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"documentId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000}},{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"allVersions","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}},{"name":"completeFolder","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/library/upload":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"uploadCompanyDocument","summary":"Original upp till 20 MB. Metadata är JSON-kodad text enligt angivet schema.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","metadata"],"properties":{"file":{"type":"string","format":"binary"},"metadata":{"type":"string","contentMediaType":"application/json","contentSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["from","to"],"additionalProperties":false},"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":180}},"name":{"type":"string","minLength":1,"maxLength":180},"itemId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"version":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["folderId","path","name"],"additionalProperties":false}}}}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"201":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/payroll/liability":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"exportVacationLiability","summary":"Semesterskuld till valt datum. Människa med separat löneexport krävs.","parameters":[{"name":"through","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["pdf","xlsx","json"]}}],"responses":{"200":{"description":"Behörighetskontrollerad fil, Cache-Control: no-store.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/payroll/import":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"importPayrollSource","summary":"Inspektera, granska eller importera ett löneunderlag. Import kräver granskningshash, bekräftelse och åtgärdsnyckel.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","input","mode"],"properties":{"file":{"type":"string","format":"binary"},"input":{"type":"string","description":"JSON-kodad payrollImportSchema med filnamn, kolumnmappning och importtyp."},"mode":{"type":"string","enum":["inspect","preview","import"]},"confirmed":{"type":"string","enum":["true"]},"reviewHash":{"type":"string"}}}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/agencies/{agencyId}/companies/{companyId}/payroll/import/reverse":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"reversePayrollImport","summary":"Återför en granskad import spårbart inom dess tillåtna tillstånd.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["id","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Aktuellt behörigt urval. Belopp är exakta decimalsträngar."},"401":{"description":"Inloggning krävs."},"403":{"description":"Mänsklig identitet och separat tilldelad rättighet krävs. Lön kräver egen rättighet."},"409":{"description":"Version, granskningsunderlag eller åtgärdsnyckel har ändrats."},"422":{"description":"Validering eller obligatorisk granskning saknas."}}}},"/client-directory":{"get":{"operationId":"getClientDirectory","summary":"Egna tillgängliga klienters grupper, etiketter, handläggare och favoriter.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig användare krävs."}}},"post":{"operationId":"saveClientFavorite","summary":"Ändra eget favoritval eller överför lokala favoriter en gång. Skapar aldrig åtkomst.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"favorite"},"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"selected":{"type":"boolean"}},"required":["kind","agencyId","companyId","version","selected"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"import"},"companyIds":{"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind","companyIds"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Aktuell bolagsåtkomst och mänsklig användare krävs."},"409":{"description":"Favoriten har ändrats eller åtgärdsnyckeln har annat innehåll."}}}},"/agencies/{agencyId}/staff":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgencyStaff","summary":"Byråmedlemmar, individuella rättigheter, åtkomstkällor, inbjudningar och historik.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Uttrycklig befogenhet att administrera byråmedlemmar krävs."}}},"post":{"operationId":"manageAgencyStaff","summary":"Bjud in, ändra byråbefogenheter eller bolagsrättigheter, återkalla inbjudan eller avsluta medlemskap efter granskning. Endast mänsklig användare.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"handover"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recipientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","id","recipientId","previewHash"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"invite"},"email":{"type":"string"},"expiresInDays":{"type":"integer","minimum":1,"maximum":30},"privileges":{"type":"object","properties":{"canCreateClients":{"type":"boolean"},"groupAccessEnabled":{"type":"boolean"},"canManageGroups":{"type":"boolean"},"canManageMembers":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["canCreateClients","groupAccessEnabled","canManageGroups","canManageMembers","expiresAt"],"additionalProperties":false}},"required":["kind","email","expiresInDays","privileges"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"revoke"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"privileges"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"privileges":{"type":"object","properties":{"canCreateClients":{"type":"boolean"},"groupAccessEnabled":{"type":"boolean"},"canManageGroups":{"type":"boolean"},"canManageMembers":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["canCreateClients","groupAccessEnabled","canManageGroups","canManageMembers","expiresAt"],"additionalProperties":false}},"required":["kind","id","version","privileges"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"grant"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedGrant":{"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["role","permissions","expiresAt"],"additionalProperties":false},{"type":"null"}]},"grant":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","enum":["admin","accountant"]},"permissions":{"minItems":1,"maxItems":32,"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["role","permissions","expiresAt"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","id","version","companyId","expectedGrant","grant"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"end"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"previewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","id","version","previewHash"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Otillräcklig byrå- eller bolagsbehörighet."},"409":{"description":"Version eller åtgärdsnyckel i konflikt."},"422":{"description":"Kvarvarande ansvar, sista administratör eller ogiltiga rättigheter."}}}},"/agencies/{agencyId}/staff/{id}/handover":{"get":{"tags":["Byråmedlemmar"],"operationId":"previewStaffHandover","summary":"Granska samlad överlämning av aktuellt ansvar och arbete","parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"recipientId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Bolagsavgränsad granskning, behörighetshinder och versionshash"}}}},"/agencies/{agencyId}/staff/{id}/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"previewStaffEnd","summary":"Granska klienter och kvarvarande ansvar inför ett medlemsavslut.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Uttrycklig byråbefogenhet krävs."}}}},"/agencies/{agencyId}/staff/{id}/invitation":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"previewStaffInvitation","summary":"Privat lokalt provmejl. Ingen extern leverans.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Uttrycklig byråbefogenhet krävs."},"409":{"description":"Inbjudan eller lokal leverans är inte tillgänglig."}}}},"/agencies/{agencyId}/client-groups":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getClientGroups","summary":"Grupper, etiketter, handläggaråtkomst och historik inom byrån.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Uttrycklig gruppadministration krävs."}}},"post":{"operationId":"saveClientGroup","summary":"Spara version av grupp, koncern eller etikett. Kräver gruppadministration och administratörsrätt i varje berört bolag. Gruppåtkomst ger ingen löne- eller administratörsrätt.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["group","corporate","tag"]},"name":{"type":"string","minLength":1,"maxLength":100},"active":{"type":"boolean"},"companyIds":{"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"members":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"principalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accessLevel":{"type":"string","enum":["read","work"]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["principalId","accessLevel","expiresAt"],"additionalProperties":false}}},"required":["id","version","kind","name","active","companyIds","members"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Uttrycklig byrå- och bolagsbehörighet krävs."},"409":{"description":"Version, namn eller åtgärdsnyckel i konflikt."},"422":{"description":"Ogiltig grupp eller otillgänglig handläggare."}}}},"/agencies/{agencyId}/companies/{companyId}/invitations":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getClientInvitations","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."}}},"post":{"operationId":"actOnClientInvitations","summary":"Bjud in eller återkalla en företagsanvändare. Kräver mänsklig byråadministratör.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create"},"email":{"type":"string"},"permissions":{"minItems":1,"maxItems":52,"type":"array","items":{"type":"string","enum":["company.read","ledger.read","documents.read","invoice.read","bank.read","payroll.read","questions.answer","module.overview","module.work","module.customer_invoices","module.supplier_invoices","module.receipts","module.ledger","module.bank","module.cash","module.reconciliations","module.periodizations","module.assets","module.payroll","module.payslips","module.reports","module.vat","module.annual_closing","module.calendar","module.registers","module.documents","module.questions","module.messages","module.transfer","module.support","module.settings","bank.write","reconcile.write","payments.record","payments.prepare","payments.approve","payroll.write","payroll.export","inbox.senders.manage","documents.upload","auditor.manage","invoice.write","invoice.approve","invoice.post","ledger.write","receipts.read_all","receipts.review","receipts.write","ledger.export","company.archive.export","company.name.write","company.tax_profile.write"]}},"expiresInDays":{"default":7,"type":"integer","minimum":1,"maximum":30}},"required":["kind","email","permissions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"revoke"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Administratör med commerce.configure krävs."},"409":{"description":"Befintlig inbjudan, behörighet eller versionskonflikt."}}}},"/agencies/{agencyId}/companies/{companyId}/invitations/{id}/preview":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"previewClientInvitation","summary":"Privat lokalt provmejl. Skickar inget mejl.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Lokal provmiljö och administratör krävs."},"404":{"description":"Ogiltig inbjudan."}}}},"/agencies/{agencyId}/companies/{companyId}/processes":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getEngagementProcess","parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["payroll","vat","accounting"]}},{"name":"period","in":"query","required":true,"schema":{"type":"string","pattern":"^(19|20|21)[0-9]{2}-(0[1-9]|1[0-2])$"}}],"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Aktiv mänsklig byråmedarbetare krävs. Lön kontrolleras separat."}}}},"/agencies/{agencyId}/companies/{companyId}/engagements":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getEngagements","description":"Intern byråplanering. mode=page ger serverfiltrerat urval med 50 rader per sida och kompakt klientstatus. history hämtar en posts historik i sidor om 50; related hämtar behöriga dialoger, avtalsursprung och processunderlag.","parameters":[{"name":"mode","in":"query","schema":{"type":"string","enum":["page"]}},{"name":"tab","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"activities","type":"string","enum":["activities","services","overview"]}},{"name":"search","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","maxLength":160}},{"name":"company","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"activity","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":""}]}},{"name":"member","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["","unassigned"]}]}},{"name":"category","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","enum":["","bookkeeping","payroll","vat","customers","suppliers","eu_sales","accounting","closing","annual_report","tax","custom"]}},{"name":"status","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","enum":["","todo","waiting","received","in_progress","done"]}},{"name":"from","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"hideDone","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"true","type":"string","enum":["true","false"]}},{"name":"withdrawn","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"false","type":"string","enum":["true","false"]}},{"name":"clients","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"active","type":"string","enum":["active","archived"]}},{"name":"sort","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"due","type":"string","enum":["due","company","name"]}},{"name":"page","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"quick","in":"query","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"","type":"string","enum":["","overdue","today","week","month"]}},{"name":"history","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"related","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Aktiv mänsklig byråmedarbetare krävs."}}},"post":{"operationId":"actOnEngagements","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"create-service"},"category":{"type":"string","enum":["bookkeeping","payroll","vat","customers","suppliers","eu_sales","accounting","closing","annual_report","tax","custom"]},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"interval":{"type":"string","enum":["weekly","monthly","quarterly","semiannual","yearly","once"]},"firstDueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"estimateMinutes":{"type":"integer","minimum":0,"maximum":100000},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"active":{"type":"boolean"},"reminderDays":{"type":"integer","minimum":0,"maximum":365},"warningDays":{"type":"integer","minimum":0,"maximum":365},"comment":{"type":"string","maxLength":4000}},"required":["name","startOn","endOn","interval","firstDueOn","estimateMinutes","assigneeId","active"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","category","body","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"engagement"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"category":{"type":"string","enum":["bookkeeping","payroll","vat","customers","suppliers","eu_sales","accounting","closing","annual_report","tax","custom"]},"name":{"type":"string","minLength":1,"maxLength":160},"active":{"type":"boolean"}},"required":["kind","version","category","name","active"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"service"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"engagementId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"startOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"interval":{"type":"string","enum":["weekly","monthly","quarterly","semiannual","yearly","once"]},"firstDueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"estimateMinutes":{"type":"integer","minimum":0,"maximum":100000},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"active":{"type":"boolean"},"reminderDays":{"type":"integer","minimum":0,"maximum":365},"warningDays":{"type":"integer","minimum":0,"maximum":365},"comment":{"type":"string","maxLength":4000}},"required":["name","startOn","endOn","interval","firstDueOn","estimateMinutes","assigneeId","active"],"additionalProperties":false},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","version","engagementId","body","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"generate"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","id","version","through"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"activity"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dueOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"estimateMinutes":{"type":"integer","minimum":0,"maximum":100000},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"comment":{"type":"string","maxLength":4000}},"required":["kind","id","version","dueOn","estimateMinutes","assigneeId","comment"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig byråmedarbetare med workspace.write krävs."},"409":{"description":"Version eller åtgärdsnyckel i konflikt."},"422":{"description":"Ogiltig tjänst eller handläggare."}}}},"/activities/status":{"post":{"operationId":"changeActivityStatus","summary":"Ändra högst 100 aktiviteter atomärt inom uttryckligen angivna bolag.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["todo","waiting","received","in_progress","done"]},"targets":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"agencyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"companyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["agencyId","companyId","id","version"],"additionalProperties":false}}},"required":["status","targets"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Byrååtkomst och workspace.write krävs i varje valt bolag."},"409":{"description":"Ingen aktivitet ändras om någon version är gammal."},"422":{"description":"Ogiltigt urval."}}}},"/agencies":{"get":{"operationId":"listClientCreationAgencies","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Aktiv mänsklig byråmedlem krävs."}}}},"/agencies/{agencyId}/companies":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"createClient","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":140},"organizationNumber":{"type":"string","pattern":"^(?:\\d{6}|\\d{8})-?\\d{4}$"},"legalForm":{"type":"string","enum":["AB","EF","HB","KB","EK","BRF","IF"]},"address":{"type":"object","properties":{"street":{"default":"","type":"string","maxLength":140},"postalCode":{"default":"","type":"string","maxLength":20},"city":{"default":"","type":"string","maxLength":70},"country":{"default":"SE","type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"year":{"type":"object","properties":{"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"method":{"type":"string","enum":["accrual","cash"]},"chart":{"type":"string","enum":["basic","import"]}},"required":["startsOn","endsOn","method","chart"],"additionalProperties":false},"setup":{"type":"object","properties":{"vatPeriod":{"type":"string","enum":["unknown","month","quarter","year","none"]},"vatPeriodEffectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"historyFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressTransition":{"type":"object","properties":{"oldAddress":{"type":"string","minLength":3,"maxLength":250},"newAddress":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"monitorThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"responsible":{"type":"string","minLength":2,"maxLength":160},"fallback":{"type":"string","minLength":10,"maxLength":1500},"mandateReference":{"type":"string","minLength":5,"maxLength":500},"state":{"type":"string","enum":["planned","checking","complete"]},"suppliers":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":160},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"notifiedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReference":{"type":"string","maxLength":500},"oldCheckedThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"newReceivedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"receiptReference":{"type":"string","maxLength":500},"unresolved":{"type":"integer","minimum":0,"maximum":100000}},"required":["id","name","email","notifiedOn","noticeReference","oldCheckedThrough","newReceivedOn","receiptReference","unresolved"],"additionalProperties":false}}},"required":["oldAddress","newAddress","startsOn","monitorThrough","responsible","fallback","mandateReference","state","suppliers"],"additionalProperties":false}},"required":["vatPeriod","historyFrom"],"additionalProperties":false}},"required":["name","organizationNumber","legalForm","address","year","setup"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Uttrycklig, giltig byråbehörighet att skapa klienter krävs."},"409":{"description":"Organisationsnummer eller åtgärdsnyckel i konflikt."},"422":{"description":"Ogiltiga klientuppgifter."}}}},"/agencies/{agencyId}/companies/{companyId}/onboarding":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getClientOnboarding","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig byråmedarbetare i klienten krävs."}}},"post":{"operationId":"updateClientOnboarding","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"settings"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"vatPeriod":{"type":"string","enum":["unknown","month","quarter","year","none"]},"vatPeriodEffectiveFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"historyFrom":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressTransition":{"type":"object","properties":{"oldAddress":{"type":"string","minLength":3,"maxLength":250},"newAddress":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"monitorThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"responsible":{"type":"string","minLength":2,"maxLength":160},"fallback":{"type":"string","minLength":10,"maxLength":1500},"mandateReference":{"type":"string","minLength":5,"maxLength":500},"state":{"type":"string","enum":["planned","checking","complete"]},"suppliers":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":160},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"notifiedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"noticeReference":{"type":"string","maxLength":500},"oldCheckedThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"newReceivedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"receiptReference":{"type":"string","maxLength":500},"unresolved":{"type":"integer","minimum":0,"maximum":100000}},"required":["id","name","email","notifiedOn","noticeReference","oldCheckedThrough","newReceivedOn","receiptReference","unresolved"],"additionalProperties":false}}},"required":["oldAddress","newAddress","startsOn","monitorThrough","responsible","fallback","mandateReference","state","suppliers"],"additionalProperties":false}},"required":["vatPeriod","historyFrom"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"year"},"body":{"type":"object","properties":{"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"method":{"type":"string","enum":["accrual","cash"]},"chart":{"type":"string","enum":["basic","import"]}},"required":["startsOn","endsOn","method","chart"],"additionalProperties":false}},"required":["kind","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"opening"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"basis":{"type":"string","minLength":5,"maxLength":1500},"lines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^(?:[0-9]{4}|TEST-[A-Z0-9]+)$"},"amount":{"type":"string","pattern":"^-?\\d{1,15}(?:\\.\\d{1,2})?$"}},"required":["accountCode","amount"],"additionalProperties":false}}},"required":["kind","fiscalYearId","basis","lines"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig byråmedarbetare med workspace.write och ledger.write krävs."},"409":{"description":"Versionskonflikt, överlappande år eller tidigare saldon/bokföring."},"422":{"description":"Ogiltiga uppgifter eller obalanserade ingående saldon."}}}},"/agencies/{agencyId}/companies/{companyId}/company-profile":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCompanyProfile","summary":"Företagets namn, organisationsnummer, F-skatt och momsnummer. Kräver mänsklig användare med company.read.","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Bolagsåtkomst krävs."}}},"post":{"operationId":"renameCompany","summary":"Ändra namn eller skatteuppgifter med respektive avgränsad behörighet. Organisationsnumret kan inte ändras här.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"name"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":140}},"required":["kind","version","name"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"tax_profile"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fTax":{"type":"boolean"},"vatNumber":{"type":"string","maxLength":30,"pattern":"^[A-Z0-9]*$"}},"required":["kind","version","fTax","vatNumber"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig användare med company.read och rätt behörighet för vald ändring krävs."},"409":{"description":"Företagsuppgifterna eller åtgärdsnyckeln har ändrats."},"422":{"description":"Ogiltigt namn, momsnummer eller extra fält."}}}},"/agencies/{agencyId}/companies/{companyId}/client-card":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getClientCard","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig byråmedarbetare med company.read krävs. AI får inte klientkortets kontaktuppgifter eller historik."}}},"post":{"operationId":"saveClientCard","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","const":"card"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"contacts":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":140},"role":{"type":"string","maxLength":100},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"phone":{"type":"string","maxLength":40}},"required":["name","role","email","phone"],"additionalProperties":false}},"auditor":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","yes","no"]},"name":{"type":"string","maxLength":140},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]}},"required":["status","name","email"],"additionalProperties":false},"links":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["label","url"],"additionalProperties":false}},"responsibleId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["contacts","auditor","links","responsibleId"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig byråmedarbetare med workspace.write krävs."},"409":{"description":"Version eller åtgärdsnyckel i konflikt."},"422":{"description":"Ogiltig kontakt, länk eller ansvarig handläggare."}}}},"/agencies/{agencyId}/companies/{companyId}/ledger":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getLedgerSnapshot","summary":"Bokföringsregister med gemensamt sök-, datum-, konto-, belopps-, ursprungs- och rättelseurval","parameters":[{"name":"from","in":"query","schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"to","in":"query","schema":{"default":"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]}},{"name":"account","in":"query","schema":{"default":"","anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"string","const":""}]}},{"name":"min","in":"query","schema":{"default":"","anyOf":[{"type":"string","pattern":"^\\d{1,18}(\\.\\d{1,2})?$"},{"type":"string","const":""}]}},{"name":"max","in":"query","schema":{"default":"","anyOf":[{"type":"string","pattern":"^\\d{1,18}(\\.\\d{1,2})?$"},{"type":"string","const":""}]}},{"name":"origin","in":"query","schema":{"default":"","type":"string","enum":["","manual","customer","supplier","payment","bank","cash","payroll","periodization","asset","tax","vat","sie","unknown"]}},{"name":"correction","in":"query","schema":{"default":"","type":"string","enum":["","corrected","reversal","replacement","unchanged"]}},{"name":"attachment","in":"query","schema":{"default":"","type":"string","enum":["","yes","no"]}},{"name":"sort","in":"query","schema":{"default":"created","type":"string","enum":["date","number","created"]}},{"name":"direction","in":"query","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"fiscalYearId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"importId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"page","in":"query","schema":{"default":1,"type":"integer","minimum":1,"maximum":1000000}},{"name":"pageSize","in":"query","schema":{"anyOf":[{"type":"number","const":50},{"type":"number","const":100},{"type":"number","const":200}]}},{"name":"query","in":"query","schema":{"default":"","type":"string","maxLength":200}},{"name":"series","in":"query","schema":{"default":"","anyOf":[{"type":"string","pattern":"^[A-Z]{1,4}$"},{"type":"string","const":""}]}}],"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Människa med ledger.read krävs."}}},"post":{"operationId":"actOnLedger","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"deleteSeries"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","pattern":"^[A-Z]{1,4}$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","fiscalYearId","code","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saveSeries"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","pattern":"^[A-Z]{1,4}$"},"name":{"type":"string","minLength":1,"maxLength":100},"active":{"type":"boolean","const":true},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","fiscalYearId","code","name","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saveSeriesAssignments"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"assignments":{"type":"object","propertyNames":{"type":"string","enum":["manual","receipt","customer_invoice","customer_payment","supplier_invoice","supplier_payment","bank","tax_account","payroll","vat","cash","asset","periodization","correction","housework","interest"]},"additionalProperties":{"type":"string","pattern":"^[A-Z]{1,4}$"}}},"required":["kind","fiscalYearId","version","assignments"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"deleteAccount"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","fiscalYearId","code","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"journalAttachment"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceType":{"type":"string","enum":["receipt","commerce","quarantine"]},"sourceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attached":{"type":"boolean"}},"required":["kind","journalId","sourceType","sourceId","attached"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"postEntry"},"body":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"bookingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"description":{"type":"string","maxLength":200},"sourceInvoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"productivityOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"defaults"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","journalId"],"additionalProperties":false}]},"automaticPostingOrigins":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAccount":{"type":"string","maxLength":30},"baseDebit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"baseCredit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["applicationId","ruleId","version","baseAccount","baseDebit","baseCredit"],"additionalProperties":false}},"receiptIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"automaticPostingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountCode":{"type":"string","maxLength":30},"debit":{"type":"string","maxLength":24},"credit":{"type":"string","maxLength":24},"info":{"type":"string","maxLength":200},"transactionDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["fiscalYearId","series","bookingDate","description","lines"],"additionalProperties":false}},"required":["kind","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"amendRows"},"originalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"string","minLength":64,"maxLength":64},"struck":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["journalId","position"],"additionalProperties":false}},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string"},"debit":{"type":"string"},"credit":{"type":"string"},"info":{"type":"string","maxLength":200},"transactionDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}},"bookingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","originalId","revision","struck","lines"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"reverseJournal"},"originalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"string","minLength":64,"maxLength":64},"body":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"bookingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"description":{"type":"string","maxLength":200},"sourceInvoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"productivityOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"defaults"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","journalId"],"additionalProperties":false}]},"automaticPostingOrigins":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAccount":{"type":"string","maxLength":30},"baseDebit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"baseCredit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["applicationId","ruleId","version","baseAccount","baseDebit","baseCredit"],"additionalProperties":false}},"receiptIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"automaticPostingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountCode":{"type":"string","maxLength":30},"debit":{"type":"string","maxLength":24},"credit":{"type":"string","maxLength":24},"info":{"type":"string","maxLength":200},"transactionDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["fiscalYearId","series","bookingDate","description","lines"],"additionalProperties":false}},"required":["kind","originalId","revision","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saveDraft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"bookingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"description":{"type":"string","maxLength":200},"sourceInvoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"productivityOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"defaults"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","journalId"],"additionalProperties":false}]},"automaticPostingOrigins":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAccount":{"type":"string","maxLength":30},"baseDebit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"baseCredit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["applicationId","ruleId","version","baseAccount","baseDebit","baseCredit"],"additionalProperties":false}},"receiptIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"automaticPostingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountCode":{"type":"string","maxLength":30},"debit":{"type":"string","maxLength":24},"credit":{"type":"string","maxLength":24},"info":{"type":"string","maxLength":200},"transactionDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["fiscalYearId","series","bookingDate","description","lines"],"additionalProperties":false}},"required":["kind","id","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"postDraft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"bookingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"description":{"type":"string","maxLength":200},"sourceInvoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"productivityOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"defaults"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","journalId"],"additionalProperties":false}]},"automaticPostingOrigins":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAccount":{"type":"string","maxLength":30},"baseDebit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"baseCredit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["applicationId","ruleId","version","baseAccount","baseDebit","baseCredit"],"additionalProperties":false}},"receiptIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"automaticPostingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountCode":{"type":"string","maxLength":30},"debit":{"type":"string","maxLength":24},"credit":{"type":"string","maxLength":24},"info":{"type":"string","maxLength":200},"transactionDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["fiscalYearId","series","bookingDate","description","lines"],"additionalProperties":false}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"deleteDraft"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"correct"},"originalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"discoveredOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"basis":{"type":"string","enum":["open_period","discovery_period"]},"reason":{"type":"string","minLength":1,"maxLength":1000},"replacement":{"anyOf":[{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"bookingDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"description":{"type":"string","maxLength":200},"sourceInvoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"productivityOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"defaults"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","journalId"],"additionalProperties":false}]},"automaticPostingOrigins":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAccount":{"type":"string","maxLength":30},"baseDebit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"baseCredit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["applicationId","ruleId","version","baseAccount","baseDebit","baseCredit"],"additionalProperties":false}},"receiptIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"automaticPostingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountCode":{"type":"string","maxLength":30},"debit":{"type":"string","maxLength":24},"credit":{"type":"string","maxLength":24},"info":{"type":"string","maxLength":200},"transactionDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["fiscalYearId","series","bookingDate","description","lines"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","originalId","fiscalYearId","date","discoveredOn","basis","reason","replacement"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"lockPeriod"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"through":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"previous":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["kind","fiscalYearId","through","previous","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"unlockPeriod"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"previous":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"through":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["kind","fiscalYearId","version","previous","through","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"savePeriodLockPolicy"},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"policy":{"type":"object","properties":{"automatic":{"default":false,"type":"boolean"},"delayDays":{"default":50,"anyOf":[{"type":"number","const":30},{"type":"number","const":40},{"type":"number","const":50},{"type":"number","const":60},{"type":"number","const":90}]},"warningDays":{"default":7,"type":"integer","minimum":0,"maximum":30},"actorLocks":{"default":[],"maxItems":250,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","enum":["principal","worker","service"]},"principalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"lockedThrough":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["target","principalId","lockedThrough"],"additionalProperties":false}}},"additionalProperties":false}},"required":["kind","fiscalYearId","version","policy"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"account"},"openingChange":{"type":"object","properties":{"amount":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"previousAmount":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"counterAccountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"previousCounterAmount":{"type":"string","pattern":"^-?(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["amount","previousAmount","counterAccountCode","previousCounterAmount"],"additionalProperties":false},"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"name":{"type":"string","minLength":1,"maxLength":200},"accountKind":{"type":"string","enum":["asset","liability","equity","revenue","expense"]},"active":{"type":"boolean"},"vatCode":{"type":["string","null"]},"sruCode":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","fiscalYearId","code","name","accountKind","active","version"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Människa med ledger.write krävs."},"409":{"description":"Version, originalpost eller åtgärdsnyckel i konflikt."},"413":{"description":"Högst 64 KiB JSON."},"422":{"description":"Felaktig kontering, konto eller period."}}}},"/agencies/{agencyId}/companies/{companyId}/ledger/sources":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getLedgerSources","summary":"Sök verkliga kvitton eller leverantörsfakturor med bolagsomfattande behandlingsstatus och sidindelning","parameters":[{"name":"kind","in":"query","schema":{"type":"string","enum":["receipts","suppliers"]}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"state","in":"query","schema":{"type":"string","enum":["pending","waiting","all","processed"]}},{"name":"source","in":"query","schema":{"type":"string","enum":["any","unlinked"]}},{"name":"id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"purchasedThrough","in":"query","schema":{"type":"string","format":"date"}},{"name":"remainingOnly","in":"query","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Underlags- respektive fakturabehörighet krävs."}}}},"/agencies/{agencyId}/companies/{companyId}/productivity":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getProductivity","summary":"Hämta bolagets bokföringshjälp och användarens arbetsfavoriter","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Bolagsåtkomst krävs."}}},"post":{"operationId":"saveProductivity","summary":"Versionsspara mallar, dimensioner, snabbtexter eller personliga favoriter","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"savePreferences"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"favoriteAccounts":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":30}},"reportFavorites":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":60}},"reportPresets":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","maxLength":40},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":200}}},"required":["id","name","kind","query"],"additionalProperties":false}}},"required":["favoriteAccounts","reportFavorites","reportPresets"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saveConfig"},"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"body":{"type":"object","properties":{"templates":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":100},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"description":{"type":"string","maxLength":200},"lines":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","maxLength":30},"info":{"type":"string","maxLength":200},"debit":{"type":"string","maxLength":160},"credit":{"type":"string","maxLength":160},"transactionDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","const":""}]},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","debit","credit"],"additionalProperties":false}},"archived":{"default":false,"type":"boolean"}},"required":["id","version","name","series","description","lines"],"additionalProperties":false}},"automaticPostings":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":100},"archived":{"default":false,"type":"boolean"},"baseAccounts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^(?:\\d{4}|TEST-[A-Z0-9]+)$"}},"lines":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","pattern":"^(?:\\d{4}|TEST-[A-Z0-9]+)?$"},"mode":{"type":"string","enum":["percent","fixed"]},"value":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,12})(?:\\.\\d{1,6})?$"},"side":{"type":"string","enum":["same","opposite"]},"info":{"type":"string","maxLength":200},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}}},"required":["accountCode","mode","value","side"],"additionalProperties":false}}},"required":["id","version","name","baseAccounts","lines"],"additionalProperties":false}},"deviationSettings":{"type":"object","properties":{"thresholdPercent":{"type":"string","pattern":"^\\d{1,5}(?:\\.\\d{1,2})?$"},"minimumDifference":{"type":"string","pattern":"^\\d{1,12}(?:\\.\\d{1,2})?$"}},"required":["thresholdPercent","minimumDifference"],"additionalProperties":false},"quickTexts":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":100},"text":{"type":"string","minLength":1,"maxLength":200},"archived":{"default":false,"type":"boolean"}},"required":["id","version","name","text"],"additionalProperties":false}},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"objects":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":200},"active":{"default":true,"type":"boolean"}},"required":["code","name"],"additionalProperties":false}}},"required":["id","version","name","superDimensionId","objects"],"additionalProperties":false}}},"required":["templates","quickTexts","dimensions"],"additionalProperties":false}},"required":["kind","version","body"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Bolagsåtkomst eller ledger.write krävs."},"409":{"description":"Version eller åtgärdsnyckel i konflikt."},"422":{"description":"Ogiltig mall, dimension eller preferens."}}}},"/agencies/{agencyId}/companies/{companyId}/transfer":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"transferHistory","parameters":[{"name":"kind","in":"query","schema":{"type":"string","enum":["all","import","sie","documents"]}},{"name":"year","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Aktuell bolags- och överföringsbehörighet krävs."}}},"post":{"operationId":"previewDocumentExport","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scope":{"type":"string","enum":["year","years","all"]},"yearIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"includeUnlinked":{"type":"boolean"},"categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["Kundfakturor","Leverantorsfakturor","Kvitton-och-utlagg","Dokument","Bankfiler","Skattekonto","Bokforingsimport","Lon","Ovrigt"]}},"series":{"type":"string","pattern":"^[A-Z0-9]{1,10}$"},"numberFrom":{"type":"string","pattern":"^[1-9]\\d{0,15}$"},"numberTo":{"type":"string","pattern":"^[1-9]\\d{0,15}$"}},"required":["scope","includeUnlinked","categories"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Dokumentexportbehörighet krävs."},"422":{"description":"Ogiltigt urval."}}}},"/agencies/{agencyId}/companies/{companyId}/sie":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"exportSie4","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"SIE4/4C i PC8 (IBM 437), valt räkenskapsår.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Människa med ledger.export krävs."},"422":{"description":"År eller PC8-text kan inte exporteras."}}},"post":{"operationId":"previewOrImportSie4","parameters":[{"name":"preview","in":"query","schema":{"type":"boolean","default":false}},{"name":"Idempotency-Key","in":"header","description":"Obligatorisk för import, inte förhandsgranskning.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"identityReviewed":{"default":false,"type":"boolean"},"fileName":{"type":"string","minLength":1,"maxLength":180},"base64":{"type":"string","maxLength":69905068,"pattern":"^[A-Za-z0-9+/]*={0,2}$"},"mapping":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^\\d{4}$"},"additionalProperties":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"}},"accountSelection":{"default":"all","type":"string","enum":["used","all"]},"namePreference":{"default":"existing","type":"string","enum":["source","existing"]},"sruPreference":{"default":"existing","type":"string","enum":["source","existing"]},"importOpeningBalances":{"type":"boolean"},"importBudget":{"default":false,"type":"boolean","const":false},"accounts":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^\\d{4}$"},"additionalProperties":{"type":"object","properties":{"action":{"type":"string","enum":["link","create","ignore"]},"target":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["asset","liability","equity","revenue","expense"]},"vatCode":{"type":["string","null"]},"sruCode":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"acceptTypeMismatch":{"default":false,"type":"boolean"}},"required":["action"],"additionalProperties":false}}},"required":["fiscalYearId","fileName","base64"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Människa med ledger.write krävs."},"409":{"description":"Åtgärdsnyckeln återanvänds eller reviewHash saknas/inte längre motsvarar den granskade filen, valen och bokföringen."},"413":{"description":"Högst 50 MiB SIE-fil, base64 i JSON med högst 128 KiB extra metadata. Högst 25 000 verifikationer och 50 000 verifikationsrader."},"422":{"description":"Format, saldon, mappning eller tidigare import i konflikt."}}}},"/agencies/{agencyId}/companies/{companyId}/export":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"exportCompanyArchive","responses":{"200":{"description":"clarent.export/4 strömmande ZIP, samtliga år och implementerade moduler. Original ordnade per räkenskapsår, verifikationsserie och nummer; filförteckning, manifest, JSON/schema, SIE och HTML-rapporter.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Full mänsklig byråbehörighet och ledger.export krävs."},"413":{"description":"4 GiB totalt, 256 MiB per fil, 512 MiB registerdata i delar, tre miljoner poster och 30 000 filer."},"422":{"description":"Original eller historik kunde inte integritetskontrolleras."},"429":{"description":"Två arkiv bearbetas redan i denna serverprocess."}}}},"/agencies/{agencyId}/companies/{companyId}/retention/package":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"verifyCompanyArchiveUpload","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Paketet har verifierats. Detta registrerar ingen mottagarkvittens.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}}}},"403":{"description":"Aktuell byråadministratör krävs före uppladdning och registrering."},"409":{"description":"Åtgärdsnyckeln har använts för ett annat arkiv."},"413":{"description":"Högst 4 GiB plus 16 MiB för paketering ZIP, 4 GiB uppackat och 256 MiB per fil."},"422":{"description":"Ofullständigt, manipulerat eller inaktuellt paket, fel bolag eller obetrodd signatur."},"429":{"description":"Två arkiv bearbetas redan i denna serverprocess."}}}},"/agencies/{agencyId}/companies/{companyId}/workspace":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getWorkspace","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Mänsklig bolagsbehörighet krävs"}}},"post":{"operationId":"actOnWorkspace","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"profile"},"reconciledThrough":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"reconciliationReview":{"type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmed":{"type":"boolean","const":true}},"required":["fiscalYearId","from","to","reviewHash","confirmed"],"additionalProperties":false},"note":{"type":"string","maxLength":2000},"version":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","reconciledThrough","note","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"decision"},"invoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"decision":{"type":"string","enum":["approved","rejected"]},"comment":{"type":"string","maxLength":1000}},"required":["kind","invoiceId","decision","comment"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Människa med receipts.write och documents.read, eller workspace.write, krävs i bolaget."},"409":{"description":"Version, åtgärdsnyckel eller fakturabeslut i konflikt"},"422":{"description":"Felaktiga uppgifter"}}}},"/agencies/{agencyId}/companies/{companyId}/reports":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getLedgerReport","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","pdf","xlsx"],"default":"json"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"fiscalYearId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"account","in":"query","schema":{"type":"string"}},{"name":"dimensionId","in":"query","schema":{"type":"string"}},{"name":"objectCode","in":"query","schema":{"type":"string"}},{"name":"kind","in":"query","schema":{"type":"string","enum":["resultat","resultat12","balans","huvudbok","kontoanalys","verifikationer","makulerade","ingaende","kontoplan"]}},{"name":"month","in":"query","schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$"}}],"responses":{"200":{"description":"Samma rapporturval som JSON, privat PDF eller Excel. Tolvmånadersrapporten visar högst tolv kalendermånader inom valt år. Ingående balans och kontoplan saknar dimensionsfilter. Resultatrapportens jämförelse anger samma period föregående år; saknat år anges uttryckligen.","content":{"application/json":{"schema":{"type":"object"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Inloggning krävs."},"403":{"description":"Människa med ledger.read i rätt bolag krävs."},"422":{"description":"Ogiltig eller inte avstämd period, alternativt format som inte stöds."}}}},"/agencies/{agencyId}/companies/{companyId}/workspace/receipts":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"saveDesignReceipt","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"description":"1–20 filer under det upprepade fältnamnet file för sidor i samma kvitto. Högst 20 MB per fil och 50 MB sammanlagt. Separata kvitton skickas som separata anrop.","properties":{"file":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","format":"binary"}},"details":{"type":"string","description":"JSON med användargranskade kvittouppgifter. Okända värden lämnas tomma."},"comment":{"type":"string","maxLength":1000}}}}}},"responses":{"201":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"receipts.write eller behörig byråpersonal krävs"},"413":{"description":"Högst 20 MB per fil och 50 MB sammanlagt"},"415":{"description":"Endast JPG, PNG, PDF och HEIC med motsvarande filsignatur"}}}},"/agencies/{agencyId}/companies/{companyId}/workspace/receipts/{receiptId}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"receiptId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadDesignReceipt","responses":{"200":{"description":"Originalfil som skyddad nedladdning"},"404":{"description":"Saknas eller otillgänglig"}}}},"/companies":{"get":{"operationId":"listCompanies","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"401":{"description":"Inloggning krävs"}}}},"/agencies/{agencyId}/companies/{companyId}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCompany","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Behörighet saknas"}}}},"/agencies/{agencyId}/companies/{companyId}/journals":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listJournals","responses":{"200":{"description":"Resultat; belopp och nummer överförs som strängar."}}},"post":{"operationId":"postTestJournal","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fiscalYearId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"series":{"type":"string","pattern":"^[A-Z]{1,4}$"},"bookingDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":{"type":"string","minLength":1,"maxLength":200},"receiptIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"sourceInvoiceId":{"type":"string","enum":["invoice-1","invoice-2","invoice-3"]},"productivityOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAmount":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["kind","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"defaults"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"journalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","journalId"],"additionalProperties":false}]},"automaticPostingOrigins":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"baseAccount":{"type":"string","maxLength":30},"baseDebit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"baseCredit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["applicationId","ruleId","version","baseAccount","baseDebit","baseCredit"],"additionalProperties":false}},"lines":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","properties":{"automaticPostingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountCode":{"type":"string","pattern":"^([0-9]{4}|TEST-[A-Z0-9]+)$"},"info":{"type":"string","maxLength":200},"transactionDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"dimensionId":{"type":"string","pattern":"^[1-9]\\d{0,9}$"},"dimensionName":{"type":"string","minLength":1,"maxLength":200},"objectCode":{"type":"string","minLength":1,"maxLength":100},"objectName":{"type":"string","minLength":1,"maxLength":200},"superDimensionId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{0,9}$"},{"type":"null"}]}},"required":["dimensionId","dimensionName","objectCode","objectName","superDimensionId"],"additionalProperties":false}},"debit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"},"credit":{"type":"string","pattern":"^(0|[1-9]\\d{0,15})(\\.\\d{1,2})?$"}},"required":["accountCode","debit","credit"],"additionalProperties":false}}},"required":["fiscalYearId","series","bookingDate","description","lines"],"additionalProperties":false}}}},"responses":{"201":{"description":"Resultat; belopp och nummer överförs som strängar."},"403":{"description":"Skrivbehörighet saknas"},"409":{"description":"Nyckeln återanvänd med annat innehåll"},"422":{"description":"Ogiltiga uppgifter, konto eller period"}}}},"/agencies/{agencyId}/companies/{companyId}/documents/{documentId}":{"parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getDocument","responses":{"200":{"description":"Skyddat syntetiskt dokument"},"404":{"description":"Saknas eller dataklassen är spärrad"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"sessionCookie":{"type":"apiKey","in":"cookie","name":"clarent.session_token"}}}}