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 /api/v2/journal-entries
Retrieve a paginated list of journal entries with filtering options. The response includes the lines and lines.dimensions relations by default.
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) |
| relation_type |
string |
No |
Filter by related entity type (e.g. document type) |
| relation_id |
integer |
No |
Filter by related entity ID |
| page |
integer |
No |
Page number for pagination (default: 1) |
| per_page |
integer |
No |
Number of items per page (default: 100) |
Error Responses
| Status |
Description |
| 403 |
Missing or invalid client_account_id, or no access to the client account |
Get Journal Entry
GET /api/v2/journal-entries/{id}
Retrieves a specific journal entry by ID. The response includes the lines, lines.dimensions, lines.account, and lines.account.mandatory_dimensions relations by default.
Path Parameters
| Parameter |
Type |
Description |
| id |
integer |
Journal entry ID |
Error Responses
| Status |
Description |
| 403 |
No access to the journal entry’s client account |
| 404 |
Journal entry not found |
Create Journal Entry
POST /api/v2/journal-entries/
Creates a new journal entry. The request body must not include an id. The created entry is returned with all default relations populated.
Note the trailing slash on this endpoint. The other journal entry endpoints (GET, PUT, PATCH, DELETE on a specific entry) do not use a trailing slash.
Request Body
| Field |
Type |
Required |
Description |
| client_account_id |
integer |
Yes |
The client account ID. Must be one of the user’s eligible accounts |
| description |
string |
No |
Free-text description of the entry |
| is_draft |
boolean |
No |
Whether the entry is a draft (drafts can be edited and deleted) |
| voucher_id |
integer |
No |
Linked voucher ID |
| relation_type |
string |
No |
Related entity type |
| relation_id |
integer |
No |
Related entity ID |
| lines |
array |
Yes |
Journal entry lines (see Line fields below) |
Line fields
| Field |
Type |
Required |
Description |
| line_id |
integer |
No |
Line sequence number within the entry |
| posting_date |
date |
Yes |
Transaction date |
| description |
string |
No |
Line description |
| account_code |
string |
Yes |
GL account code (or account_id) |
| account_id |
integer |
No |
GL account ID (alternative to account_code) |
| debit |
decimal |
Yes |
Debit amount in base currency (use 0 for credit-only lines) |
| credit |
decimal |
Yes |
Credit amount in base currency (use 0 for debit-only lines) |
| debit_fc |
decimal |
No |
Foreign currency debit amount |
| credit_fc |
decimal |
No |
Foreign currency credit amount |
| currency_code |
string |
No |
Currency code (defaults to the client account’s accounting currency) |
| exchange_rate |
decimal |
No |
Currency conversion rate |
| tax_code |
string |
No |
Applied tax code |
| tax_base_amount |
decimal |
No |
Base amount for tax |
| tax_amount |
decimal |
No |
Calculated tax amount |
| tax_line |
string |
No |
Tax line indicator |
| tax_for_line |
integer |
No |
Related line ID for tax |
| quantity |
decimal |
No |
Quantity associated with the line |
| dimensions |
array |
No |
Dimensions attached to the line |
Example Request
{
"client_account_id": 7,
"description": "Office supplies",
"is_draft": false,
"lines": [
{
"posting_date": "2026-04-10",
"account_code": "6800",
"debit": "1000.00",
"credit": "0",
"currency_code": "NOK"
},
{
"posting_date": "2026-04-10",
"account_code": "2400",
"debit": "0",
"credit": "1000.00",
"currency_code": "NOK"
}
]
}
Response
Returns the created journal entry with status 201 Created.
Error Responses
| Status |
Description |
| 400 |
Missing JSON body, id set in request, or validation error (e.g. unbalanced lines) |
| 403 |
No access to the client account |
Update Journal Entry
PUT /api/v2/journal-entries/{id}
Replaces the contents of a draft journal entry. Only entries where is_draft is true may be updated — attempts to update a posted entry return 400. The full set of lines should be sent; existing lines are replaced.
Path Parameters
| Parameter |
Type |
Description |
| id |
integer |
Journal entry ID |
Request Body
Same shape as Create Journal Entry. The client_account_id cannot be changed.
Response
Returns the updated journal entry with status 200 OK.
Error Responses
| Status |
Description |
| 400 |
Missing JSON body, validation error, or entry is not a draft |
| 403 |
No access to the journal entry’s client account |
Cancel (Reverse) Journal Entry
PATCH /api/v2/journal-entries/{id}
Cancels a posted journal entry by creating a reversal entry. The original entry is marked with cancelled: "Y", and a new entry with opposite debits and credits is posted on the current date. The new entry’s ID is recorded as cancellation_entry_id on the original.
Path Parameters
| Parameter |
Type |
Description |
| id |
integer |
Journal entry ID to cancel |
Request Body
| Field |
Type |
Required |
Description |
| cancelled |
string |
Yes |
Must be "Y" to trigger cancellation. Any other value is a no-op |
| cancellation_reason |
string |
No |
Description used on the reversal entry |
Example Request
{
"cancelled": "Y",
"cancellation_reason": "Posted in wrong period"
}
Response
Returns the original journal entry (now marked cancelled) with status 200 OK. To retrieve the reversal entry, look up cancellation_entry_id.
Error Responses
| Status |
Description |
| 403 |
No access to the journal entry’s client account |
| 404 |
Journal entry not found |
Delete Journal Entry
DELETE /api/v2/journal-entries/{id}
Deletes a draft journal entry. Posted entries cannot be deleted — use the PATCH cancellation flow instead.
Path Parameters
| Parameter |
Type |
Description |
| id |
integer |
Journal entry ID |
Response
Returns an empty object with status 200 OK.
Error Responses
| Status |
Description |
| 400 |
Entry is not a draft |
| 403 |
No access to the journal entry’s client account |
| 404 |
Journal entry not found |
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 |
| description |
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 |
| relation_number |
string |
Related entity display number (read-only) |
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,
"description": "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,
"relation_number": 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 (
is_draft: true)
- Posted entries can only be cancelled via
PATCH with cancelled: "Y", which creates a reversal entry
- 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
- The
POST endpoint requires a trailing slash (/journal-entries/); other operations do not
- GET endpoints include related resources by default