Vouchers API

Vouchers

Vouchers represent financial documents in the system that can be linked to various entities such as documents, journal entries, and collections. They form a crucial part of the financial document management system.

Status Values

Voucher Status

| Value | Description | |——-|————-| | PENDING | Initial state, voucher awaiting processing | | DRAFT | Voucher is being worked on, can be modified | | ARCHIVED | Voucher has been archived and is no longer active | | BOOKED | Voucher has been posted to the accounting system | | DELETED | Voucher has been marked as deleted |

Document Types

Accounts Receivable Documents

| Value | Description | |——-|————-| | ARINV | AR Invoice - Customer invoice | | ARCRN | AR Credit Note - Customer credit note | | ARCIN | AR Cash Invoice - Customer cash invoice | | ARPIN | AR Proforma Invoice - Customer proforma invoice | | ARDEB | AR Debt Collection - Customer debt collection document |

Accounts Payable Documents

| Value | Description | |——-|————-| | APINV | AP Invoice - Supplier invoice | | APCRN | AP Credit Note - Supplier credit note | | RECPT | AP Receipt - Supplier receipt | | APCIN | AP Cash Invoice - Supplier cash invoice | | APPIN | AP Proforma Invoice - Supplier proforma invoice | | APDEB | AP Debt Collection - Supplier debt collection document |

Settlement Documents

| Value | Description | |——-|————-| | PAYSR | Payment Settlement Report | | SALSM | Sales Summary | | VATST | VAT Settlement - For payment of VAT | | VATRP | VAT Report - For reporting VAT |

Payroll Documents

| Value | Description | |——-|————-| | PRPAY | Payroll Payment List | | PRTAX | Payroll Tax Settlement |

Workflow Status

| Value | Description | |——-|————-| | IMAGE_PROCESSING | Document image is being processed and text extracted | | STARTING_WORKFLOW | Initial workflow setup is in progress | | CLASSIFICATION | Document type is being determined | | DATA_EXTRACTION | Relevant data is being extracted from the document | | WAITING_FOR_ANSWER | Workflow is paused waiting for user input | | DUPLICATE_CHECK | Checking for duplicate documents | | BOOKING | Document is being posted to the accounting system | | CANCELLED | Workflow has been cancelled | | COMPLETED | Workflow has completed successfully |

List Vouchers

GET /api/v2/vouchers

Retrieves a paginated list of vouchers based on specified filters.

Query Parameters

Parameter Type Description
client_account_id integer[] Filter by specific client account IDs
status string[] Filter by voucher status (see Voucher Status table above)
document_type string[] Filter by document type (see Document Types tables above)
document_status string[] Filter by document status
payment_status string[] Filter by payment status
document_date_from date Filter by document date range start (YYYY-MM-DD)
document_date_to date Filter by document date range end (YYYY-MM-DD)
due_date_from date Filter by due date range start (YYYY-MM-DD)
due_date_to date Filter by due date range end (YYYY-MM-DD)
business_partner_id integer[] Filter by business partner IDs
collection_id integer[] Filter by collection IDs
project_id integer[] Filter by project IDs
free_text string Search across voucher fields and related documents
has_project boolean Filter vouchers with/without projects
has_collection boolean Filter vouchers with/without collections
has_journal_entry boolean Filter vouchers with/without journal entries
has_document boolean Filter vouchers with/without documents
has_attachment boolean Filter vouchers with/without attachments
order_by string Sort field and direction (e.g., “created_at desc”)
with string[] Include related objects in response
page integer Page number for pagination (default: 1)
per_page integer Items per page (default: 100, max: 100)

Response Fields

Field Type Description
id integer Unique identifier
created_at datetime Creation timestamp
document_date date Date of the voucher document
status string Current status of the voucher (see Voucher Status table above)
collection_id integer ID of associated collection
project_id integer ID of associated project
workflow_status string Current workflow status (see Workflow Status table above)

The following related objects can be included using the with parameter:

  • attachments: Associated file attachments
  • documents: Linked commercial documents
  • document: Primary document
  • journal_entries: Associated journal entries
  • journal_entry: Primary journal entry
  • statements: Associated statements
  • statement: Primary statement
  • payroll_run: Associated payroll run
  • tasks: Related worker tasks
  • questions: Associated accounting questions
  • collection: Associated voucher collection
  • project: Associated project

Example Request

GET /api/v2/vouchers?status[]=PENDING&document_date_from=2024-01-01&with[]=documents&with[]=journal_entries

Example Response

{
  "items": [
    {
      "id": 1234,
      "created_at": "2024-01-15T10:30:00Z",
      "document_date": "2024-01-15",
      "status": "PENDING",
      "collection_id": 567,
      "project_id": 890,
      "workflow_status": "DATA_EXTRACTION",
      "documents": [
        {
          "id": 456,
          "type": "APINV",
          "status": "PENDING"
        }
      ],
      "journal_entries": [
        {
          "id": 789,
          "posting_date": "2024-01-15",
          "status": "DRAFT"
        }
      ]
    }
  ],
  "total": 45,
  "page": 1,
  "per_page": 100
}

Get Single Voucher

GET /api/v2/vouchers/{id}

Retrieves a specific voucher by ID.

Path Parameters

Parameter Type Description
id integer Voucher ID

Example Request

GET /api/v2/vouchers/1234?with[]=documents&with[]=journal_entries

Example Response

{
  "id": 1234,
  "created_at": "2024-01-15T10:30:00Z",
  "document_date": "2024-01-15",
  "status": "PENDING",
  "collection_id": 567,
  "project_id": 890,
  "workflow_status": "DATA_EXTRACTION",
  "documents": [
    {
      "id": 456,
      "type": "APINV",
      "status": "PENDING"
    }
  ],
  "journal_entries": [
    {
      "id": 789,
      "posting_date": "2024-01-15",
      "status": "DRAFT"
    }
  ]
}

Error Responses

Status Code Description
404 Voucher not found
403 No access to voucher

Relaterte artikler