Vouchers

Vouchers Endpoint

The vouchers endpoint allows you to retrieve vouchers.

GET /vouchers

Get a list of vouchers.

Parameters

  • client_account_id (int list) - Filter by client account ID. If not provided, uses the client accounts available to the authenticated user.
  • status (string list) - Filter by voucher status. Values: PENDING, DRAFT, BOOKED, DELETED. Document parameters (using dot notation):
  • document.document_type (string list) - Filter by document type. Values from ObjectTypes enum.
  • document.document_status (string list) - Filter by document status.
  • document.payment_status (string list) - Filter by payment status.
  • document.document_date_from (date) - Filter documents from this date.
  • document.document_date_to (date) - Filter documents until this date.
  • document.due_date_from (date) - Filter documents with due date from this date.
  • document.due_date_to (date) - Filter documents with due date until this date.
  • document.pending_payment_amount (decimal) - Filter by pending payment amount.
  • document.is_payable (bool) - Filter payable documents.
  • document.is_unpaid (bool) - Filter unpaid documents.

Other parameters:

  • business_partner_id (int list) - Filter by business partner ID.
  • collection_id (int list) - Filter by collection ID.
  • project_id (int list) - Filter by project ID.
  • free_text (string) - Free text search on voucher fields.
  • has_project (bool) - Filter vouchers that have a project.
  • has_collection (bool) - Filter vouchers that have a collection.
  • has_journal_entry (bool) - Filter vouchers that have a journal entry.
  • has_document (bool) - Filter vouchers that have a document.
  • has_attachment (bool) - Filter vouchers that have attachments.
  • order_by (string list) - Order results by field and direction e.g. created_at desc.
  • page (int) - The page number to retrieve. Default is 1.
  • per_page (int) - Number of results per page. Default is 100.
  • with (string) - Relations to include. Comma separated list.

Response

{
  "meta": {
    "records": 123,
    "per_page": 100,
    "page": 1,
    "pages": 2
  },
  "data": [
    {
      "id": 1,
      "created_at": "2023-01-01T12:00:00Z",
      "created_by_id": 123,
      "updated_at": "2023-01-02T15:00:00Z", 
      "updated_by_id": 456,
      "client_account_id": 789,
      "type": "INVOICE",
      "file_name": "invoice.pdf",
      "content_type": "application/pdf",
      "status": "BOOKED",
      "collection_id": 234, 
      "project_id": 345,
      "thumbnail_url": "https://example.com/thumbnail.jpg",
      "download_url": "https://example.com/download.pdf",  
      "original_url": "https://example.com/original.pdf",
      "is_active": true,
      
      // Relations
      "attachments": [...], 
      "documents": [...],
      "document": {...},
      "journal_entries": [...],
      "journal_entry": {...},
      "statements": [...],
      "statement": {...},
      "payroll_run": {...},
      "tasks": [...],
      "questions": [...]
    }
  ]
}

The with parameter allows including related objects in the response. Supported relations are:

  • attachments - Voucher attachments
  • documents - Documents related to the voucher
  • document - The main document for the voucher
  • journal_entries - Journal entries for the voucher
  • journal_entry - The main journal entry for the voucher
  • statements - Voucher statements
  • statement - The main statement for the voucher
  • payroll_run - Related payroll run
  • tasks - Related tasks
  • questions - Related accounting questions

Multiple relations can be included by separating with commas e.g. with=documents,journal_entry.

GET /vouchers/{id}

Get a single voucher by ID.

Response

Same as above but for a single voucher object.

Relaterte artikler