Fortnox Vouchers API

Accounting vouchers (journal entries).

OpenAPI Specification

fortnox-vouchers-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Fortnox REST API (Representative Subset) Accounts Vouchers API
  description: 'Grounded OpenAPI description of the Fortnox REST API - the Swedish cloud accounting/ERP platform for SMBs and accounting bureaus. Base URL is https://api.fortnox.se/3/. Authentication is OAuth2 Authorization Code Flow: each request carries the Access-Token (Bearer JWT, 1h) header plus the Client-Secret header issued to your Fortnox app. The old fixed Access-Token/Client-Secret integration keys were deprecated 2025-04-30.


    SCOPE / FIDELITY NOTE: The Fortnox API exposes 40+ resources. This document ships a solid, representative SUBSET (Invoices, Customers, Articles, Orders, Offers, Vouchers, Accounts, Financial Years, Suppliers, Supplier Invoices, Projects) with pragmatic, partial field-level schemas. Paths, methods, identifiers, the wrapper-object response envelope (e.g. { "Invoice": {...} }, { "Invoices": [...] }), and auth are grounded in Fortnox''s developer documentation. Per-field property coverage is intentionally partial and MODELED/summarized from the docs, not transcribed field-for-field for every resource. Verify exact field sets and validation against https://api.fortnox.se/apidocs before production use.'
  version: '3.0'
  contact:
    name: Fortnox Developer
    url: https://www.fortnox.se/developer
  license:
    name: Fortnox API License / Terms
    url: https://www.fortnox.se/developer
servers:
- url: https://api.fortnox.se/3
  description: Fortnox REST API v3
security:
- accessToken: []
  clientSecret: []
tags:
- name: Vouchers
  description: Accounting vouchers (journal entries).
paths:
  /vouchers:
    get:
      operationId: listVouchers
      tags:
      - Vouchers
      summary: List vouchers
      parameters:
      - name: financialyear
        in: query
        description: Financial year ID to scope the vouchers to.
        schema:
          type: integer
      responses:
        '200':
          description: A list of vouchers.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Vouchers:
                    type: array
                    items:
                      $ref: '#/components/schemas/Voucher'
                  MetaInformation:
                    $ref: '#/components/schemas/MetaInformation'
    post:
      operationId: createVoucher
      tags:
      - Vouchers
      summary: Create a voucher
      description: Posts a double-entry voucher into a voucher series.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                Voucher:
                  $ref: '#/components/schemas/Voucher'
      responses:
        '201':
          $ref: '#/components/responses/VoucherResponse'
  /vouchers/{VoucherSeries}/{VoucherNumber}:
    parameters:
    - name: VoucherSeries
      in: path
      required: true
      schema:
        type: string
    - name: VoucherNumber
      in: path
      required: true
      schema:
        type: integer
    - name: financialyear
      in: query
      schema:
        type: integer
    get:
      operationId: getVoucher
      tags:
      - Vouchers
      summary: Retrieve a voucher
      responses:
        '200':
          $ref: '#/components/responses/VoucherResponse'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ErrorResponse:
      type: object
      description: Fortnox error envelope.
      properties:
        ErrorInformation:
          type: object
          properties:
            Error:
              type: integer
            Message:
              type: string
            Code:
              type: integer
    VoucherRow:
      type: object
      description: A single debit/credit line in a voucher.
      properties:
        Account:
          type: integer
        Debit:
          type: number
        Credit:
          type: number
        Description:
          type: string
        TransactionInformation:
          type: string
    MetaInformation:
      type: object
      description: Pagination metadata returned on list endpoints.
      properties:
        '@TotalResources':
          type: integer
        '@TotalPages':
          type: integer
        '@CurrentPage':
          type: integer
    Voucher:
      type: object
      description: A double-entry accounting voucher (journal entry).
      properties:
        VoucherSeries:
          type: string
        VoucherNumber:
          type: integer
          readOnly: true
        TransactionDate:
          type: string
          format: date
        Description:
          type: string
        Year:
          type: integer
        VoucherRows:
          type: array
          items:
            $ref: '#/components/schemas/VoucherRow'
      required:
      - VoucherSeries
      - TransactionDate
      - VoucherRows
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    VoucherResponse:
      description: A single voucher.
      content:
        application/json:
          schema:
            type: object
            properties:
              Voucher:
                $ref: '#/components/schemas/Voucher'
  securitySchemes:
    accessToken:
      type: apiKey
      in: header
      name: Access-Token
      description: OAuth2 Access-Token (Bearer JWT, valid 1 hour) obtained via the Authorization Code Flow from https://apps.fortnox.se/oauth-v1/token. Sent in the Access-Token header on every request.
    clientSecret:
      type: apiKey
      in: header
      name: Client-Secret
      description: The Client-Secret issued to your registered Fortnox developer application. Sent in the Client-Secret header alongside the Access-Token on every request.