Journal Entries

Journal Entries API

Journal entries are the fundamental records of financial transactions in Snapbooks. They capture the movement of value between accounts and serve as the foundation for financial reporting, supporting various transaction types including sales, purchases, payments, receipts, and adjustments.

API Endpoints

Method Endpoint Description
GET /journal-entries List journal entries
POST /journal-entries Create a journal entry
GET /journal-entries/{id} Get a journal entry
PUT /journal-entries/{id} Update a journal entry
PATCH /journal-entries/{id} Partially update a journal entry
DELETE /journal-entries/{id} Delete a journal entry

List Journal Entries

GET /journal-entries

Retrieve a paginated list of journal entries with filtering options.

Query Parameters

Parameter Type Required Description
client_account_id integer Yes Filter by client account ID (must be from user’s eligible accounts)
date_from date No Filter entries from this date (inclusive)
date_to date No Filter entries to this date (inclusive)
page integer No Page number for pagination (default: 1)
per_page integer No Number of items per page (default: 100)

Journal Entry Properties

Main Attributes

Attribute Type Description
id integer The ID of the journal entry
created_at date Creation timestamp
created_by_id integer Creator’s user ID
updated_at date Last update timestamp
updated_by_id integer Last updater’s user ID
client_account_id integer Associated client account ID
sequence_number integer Sequential identifier
memo string Transaction description
cancelled string Cancellation status
cancelled_by_id integer Canceller’s user ID
cancellation_entry_id integer ID of cancellation entry
cancellation_reason string Reason for cancellation
is_draft boolean Draft status indicator
voucher_id integer Associated voucher ID
relation_type string Related entity type
relation_id integer Related entity ID

Journal Entry Line Properties

Attribute Type Description
id integer Line item ID
journal_entry_id integer Parent entry ID
line_id integer Line sequence number
posting_date date Transaction date
description string Line item description
account_code string GL account code
account_id integer GL account ID
debit decimal Base currency debit amount
debit_fc decimal Foreign currency debit amount
credit decimal Base currency credit amount
credit_fc decimal Foreign currency credit amount
currency_code string Currency code
currency_id integer Currency ID
exchange_rate decimal Currency conversion rate
tax_code string Applied tax code
tax_code_id integer Tax code ID
tax_base_amount decimal Base amount for tax
tax_base_amount_fc decimal Foreign currency base amount for tax
tax_amount decimal Calculated tax amount
tax_amount_fc decimal Foreign currency tax amount
tax_line string Tax line indicator
tax_for_line integer Related line ID for tax
reconciled_amount decimal Reconciled amount
reconciled_amount_fc decimal Foreign currency reconciled amount
external_reconciled_amount decimal External reconciliation amount
Relationship Type Description
created_by User Entry creator
updated_by User Last updater
lines JournalEntryLine Entry line items
lines.dimensions [Dimension] Line dimensions
lines.account GeneralLedgerAccount Associated GL account
lines.account.mandatory_dimensions [MandatoryDimension] Required dimensions

Example Response

{
    "id": 1,
    "created_at": "2023-05-10T12:00:00Z",
    "created_by_id": 1,
    "updated_at": "2023-05-10T12:00:00Z",
    "updated_by_id": 1,
    "client_account_id": 1,
    "sequence_number": 1,
    "memo": "Sample journal entry",
    "cancelled": null,
    "cancelled_by_id": null,
    "cancellation_entry_id": null,
    "cancellation_reason": null,
    "is_draft": false,
    "voucher_id": null,
    "relation_type": null,
    "relation_id": null,
    "lines": [
        {
            "id": 1,
            "journal_entry_id": 1,
            "line_id": 1,
            "posting_date": "2023-05-10",
            "description": "Sample line item",
            "account_code": "1000",
            "account_id": 1,
            "debit": "100.00",
            "debit_fc": "100.00",
            "credit": "0.00",
            "credit_fc": "0.00",
            "currency_code": "USD",
            "currency_id": 1,
            "exchange_rate": "1.0000",
            "tax_code": "VAT",
            "tax_code_id": 1,
            "tax_base_amount": "100.00",
            "tax_base_amount_fc": "100.00",
            "tax_amount": "10.00",
            "tax_amount_fc": "10.00",
            "tax_line": null,
            "tax_for_line": null,
            "reconciled_amount": "0.00",
            "reconciled_amount_fc": "0.00",
            "external_reconciled_amount": "0.00",
            "dimensions": [],
            "account": {
                "id": 1,
                "account_code": "1000",
                "description": "Bank Account",
                "mandatory_dimensions": []
            }
        }
    ]
}

Important Notes

  • Updates and deletions are restricted to draft entries
  • Client account ID must be from user’s eligible accounts
  • Line items are automatically managed with entry operations
  • Currency fields with _fc suffix indicate foreign currency amounts
  • Tax fields support VAT and other tax calculations
  • Cancellation via PATCH with cancelled: "Y" creates reversal entry
  • GET endpoints include related resources by default

Relaterte artikler