Menu

Compliance check

Pre-flight verification: voucher gaps, year-end readiness, before submitting to Skatteverket.

Endpoints


GET /api/v1/companies/:companyId/compliance/check

compliance.check · scope compliance:read

Run a structured compliance pre-flight check.

Generalised pre-flight that consolidates the Accounted pre-close validators under one envelope. Supported check types: year_end_readiness (BFNAR 2017:3 + ÅRL 2:1 blockers), voucher_gaps (BFNAR 2013:2 kap 8 § series continuity), vat_close (can the momsperiod be closed: SKV 4700 rutor, bookkeeping blockers and the momsdeklaration completeness checks the web filing UI uses; the same answer as the MCP tool gnubok_vat_close_check). New types can be added without changing the response shape.

Use when: Before committing to an irreversible action (VAT close, year-end close), or as a periodic audit sweep to surface blockers before they become urgent.

Don't use for: Executing the underlying action: this is read-only. After a passing check, call the corresponding async endpoint (POST /fiscal-periods/{id}/year-end, etc).

Pitfalls

  • year_end_readiness and voucher_gaps require fiscal_period_id (UUID); vat_close requires period_type, year and period.
  • voucher_gaps covers EVERY voucher series registered for the period (A, B, F, ...), not only series A.
  • A passing check is a SNAPSHOT: the state can change between the check and the action. The same blocker logic runs again on commit.
  • vat_close: details carries the rutor signed exactly as the momsdeklaration files them (ruta49 = to pay, negative = refund; a box whose credit notes exceed its sales is negative), the payment block with the deadline, and sanity, a comparison with the previous period of the same length.
  • vat_close: details.sanity is advisory and never changes ready. ratios.rate_shares gives each rate's share (25/12/6, percent) of the taxable base derived from output VAT (ruta 10/11/12 divided by the rate), for the current and previous period, null when a period has no sales or a negative rate. anomalies: rate_share_shift (one per rate whose share moved at least 15 percentage points while its base moved at least max(25000 kr, 10 % of the larger total); delta_pct is in percentage points), revenue_drop and revenue_spike (ruta 05 down more than 50 % or up more than 200 %, skipped when both periods are below 25000 kr). ratios.output_vat_ratio_25/12/6 are deprecated: read rate_shares.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Query parameters

NameTypeRequiredDescription
type"year_end_readiness" | "voucher_gaps" | "vat_close"yesWhich check to run.
fiscal_period_idstringnoFiscal period to check (id from GET /fiscal-periods). Required by year_end_readiness and voucher_gaps.
period_type"monthly" | "quarterly" | "yearly"novat_close: the momsperiod length.
yearnumbernovat_close: the year; for yearly, the year the räkenskapsår ends.
periodnumbernovat_close: 1-12 monthly, 1-4 quarterly, 1 yearly.

Response fields

NameType
typestring
readyboolean
findingsobject[]
summarystring
generated_atstring
paramsobject

Example response

{
  "data": {
    "type": "year_end_readiness",
    "ready": false,
    "findings": [
      {
        "severity": "blocker",
        "code": "YEAR_END_DRAFTS_PRESENT",
        "message": "3 draft journal entries must be committed or cancelled before year-end.",
        "details": {
          "draft_count": 3
        }
      }
    ],
    "summary": "Period is NOT ready (1 blocker(s)).",
    "generated_at": "2026-05-12T14:00:00Z",
    "params": {
      "fiscal_period_id": "a8f1…"
    }
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}