Skip to content

Journal Transaction ​

Introduction ​

Journal transactions are the core bookkeeping entries in the accounting system, representing the double-entry bookkeeping principle where each transaction affects at least two accounts. They form the backbone of the Swiss KMU accounting structure.

Each journal transaction contains multiple journal entries that record the specific debits and credits to individual accounts. The transaction serves as the container that groups related entries together and ensures they balance (total debits equal total credits). This structure maintains the integrity of double-entry bookkeeping while providing a clear audit trail for each business event.

Manual Bookings

To create, update, delete, or reverse journal transactions through the API, use the Manual Booking resource. Direct manipulation of journal transactions via the API is not allowed to maintain accounting integrity.

Transaction Types ​

TypeDescription
SingleSimple transaction with exactly two journal entries (one debit, one credit)
CompoundComplex transaction with more than two journal entries

Document Types ​

Journal transactions can be linked to various source documents:

Document TypeDescription
invoiceSales invoices
invoice_paymentInvoice payment records
expenseExpense records
expense_paymentExpense payment records
bank_transactionBank transaction records
customer_transactionCustomer transaction records
manual_bookingManual accounting entries

Allowed query parameters ​

Filters ​

FilterTypeDescription
numberStringExact match on transaction number
document_numberStringExact match on document number
document_typeStringFilter by document type: invoice, invoice_payment, expense, expense_payment, bank_transaction, customer_transaction, manual_booking
searchStringFull-text search across transaction data
date_rangeStringDate range filter (format: YYYY-MM-DD,YYYY-MM-DD)
amount_rangeString/ArrayAmount range filter
includes_accountString/IntegerFilter transactions that include a specific account
includes_vat_rateStringFilter transactions that include a specific VAT rate
sourceStringFilter manual bookings by import source (e.g. stripe, lightspeed, shopify, bexio, banana, abasalary, selectline, csv_import)
memberStringFilter by member ID

Sorting ​

posted_at, number_sequence, document_number

Includes ​

document, entries.account, entries.vatRate, fiscalYear, media, member.user.media

Appends ​

summary - Transaction summary data (requires appropriate permissions)

Retrieve a journal transaction ​

get
/journal_transaction/{id}

Example response ​

json
// HTTP 200 OK
{
    "id": "v7rnRjBn9o",
    "number": "TX-1001",
    "posted_at": "2024-03-15",
    "document": {
        "id": "abc123",
        "type": "invoice",
        "number": "INV-2024-001"
    },
    "document_id": "abc123",
    "document_type": "invoice",
    "document_number": "INV-2024-001",
    "fiscal_year": {
        "id": "fyxyz789",
        "name": "2024",
        "start_date": "2024-01-01",
        "end_date": "2024-12-31"
    },
    "description": "Sales invoice payment",
    "entries": [
        {
            "id": "entry1",
            "account": {
                "id": "acc1",
                "number": "1020",
                "name": "Bank Account"
            },
            "debit_amount": 1080.0,
            "credit_amount": 0,
            "type": "debit",
            "currency": "CHF"
        },
        {
            "id": "entry2",
            "account": {
                "id": "acc2",
                "number": "3400",
                "name": "Sales Revenue"
            },
            "debit_amount": 0,
            "credit_amount": 1000.0,
            "type": "credit",
            "currency": "CHF"
        }
    ],
    "type": "single",
    "amount": 1080.0,
    "currency": "CHF",
    "original_amount": 1080.0,
    "is_locked": false,
    "is_future": false,
    "debit_account": {
        "id": "acc1",
        "number": "1020",
        "name": "Bank Account"
    },
    "credit_account": {
        "id": "acc2",
        "number": "3400",
        "name": "Sales Revenue"
    },
    "debit_vat_rate_id": null,
    "credit_vat_rate_id": "vat123",
    "member": {
        "id": "mem1",
        "name": "John Doe"
    },
    "reverses": null,
    "reversed_by": null,
    "can_delete": false,
    "can_edit_in_place": false,
    "edit_requires_reversal": false,
    "can_reverse": false,
    "default_reversal_date": null
}

Reversal and immutability fields ​

The following fields are populated for manual bookings. For all other transactions they are null (false for the booleans). They are only returned by GET /journal_transaction, GET /journal_transaction/{id}, GET /journal_entry and GET /journal_entry/{id} with include=transaction (on the nested transaction), the reverse response and the transaction in the POST /journal response.

FieldTypeDescription
reversesObject?{id, number} of the original booking when this transaction is a reversal, otherwise null
reversed_byObject?{id, number} of the reversal booking when this transaction was reversed, otherwise null
can_deleteBooleanWhether the booking can be deleted. false for older bookings while the immutable journal is enabled, and for bookings that were already reversed
can_edit_in_placeBooleanWhether the booking can be edited in place. false for older bookings while the immutable journal is enabled, and for reversed bookings
edit_requires_reversalBooleantrue when updating the booking via POST /journal with id reverses it and creates a new booking: the immutable journal is enabled, the booking was created before today and it was not reversed
can_reverseBooleanWhether the booking can be reversed. true also in a closed fiscal year (the reversal is then posted on the first open date), false for bookings that were already reversed
default_reversal_dateDate?Date (YYYY-MM-DD) a reversal gets when no date is given: the booking date if its fiscal year and VAT period are open, otherwise the first open date. null for bookings that were already reversed

List journal transactions ​

get
/journal_transaction

The list endpoint accepts the same parameters as in Retrieve a journal transaction and returns a paginated array of the same transaction object in the data property.

Read more about Pagination, Filtering, Sorting and Includes on the Introduction page.

Example response ​

json
// HTTP 200 OK
{
    "data": [
        {
            // transaction object
        }
    ],
    "links": {
        "first": "https://api.example.com/journal_transaction?page=1",
        "last": "https://api.example.com/journal_transaction?page=10",
        "prev": null,
        "next": "https://api.example.com/journal_transaction?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 10,
        "per_page": 15,
        "to": 15,
        "total": 150
    },
    "summary": {
        "total": 125430.5
    }
}