Skip to content

General Journal Documents

Manage your General Journal Documents in Moneybird.

Working with General Journal Documents

This section covers how to interact with Moneybird’s General Journal Documents API. You can create, retrieve, update, and delete general journal documents, as well as manage attachments.

Basic Operations

Get a General Journal Document

Retrieve a general journal document by its ID.

$generalJournalDocument = $client->generalJournalDocuments()->get('123456789');

List General Journal Documents

Get a paginated list of general journal documents.

$generalJournalDocuments = $client->generalJournalDocuments()->paginate();
// Iterate through the pages
foreach ($generalJournalDocuments as $generalJournalDocument) {
echo $generalJournalDocument->reference;
}

Get All General Journal Documents

Get all general journal documents at once.

$allGeneralJournalDocuments = $client->generalJournalDocuments()->all();
// Iterate through all general journal documents
foreach ($allGeneralJournalDocuments as $generalJournalDocument) {
echo $generalJournalDocument->reference;
}

Create a General Journal Document

Create a new general journal document.

$data = [
'reference' => 'Journal Entry #2025-001',
'date' => '2025-03-01',
'details_attributes' => [
[
'ledger_account_id' => '123456',
'debit' => '1000.00',
'description' => 'Debit entry'
],
[
'ledger_account_id' => '789012',
'credit' => '1000.00',
'description' => 'Credit entry'
]
]
];
$generalJournalDocument = $client->generalJournalDocuments()->create($data);

Update a General Journal Document

Update an existing general journal document.

$updateData = [
'reference' => 'Journal Entry #2025-001 - Updated',
'date' => '2025-03-02'
];
$generalJournalDocument = $client->generalJournalDocuments()->update('123456789', $updateData);

Delete a General Journal Document

Delete a general journal document.

$client->generalJournalDocuments()->delete('123456789');

Working with Attachments

Add an Attachment to a General Journal Document

Add an attachment to a general journal document.

$attachmentData = [
'filename' => 'journal.pdf',
'content' => base64_encode(file_get_contents('path/to/journal.pdf'))
];
$attachment = $client->generalJournalDocuments()->createAttachment('123456789', $attachmentData);

Delete an Attachment from a General Journal Document

Delete an attachment from a general journal document.

$client->generalJournalDocuments()->deleteAttachment('123456789', 'attachment_id');

Specialized Features

Synchronize General Journal Documents

Synchronize a list of general journal documents by their IDs.

$ids = ['123456789', '987654321'];
$generalJournalDocuments = $client->generalJournalDocuments()->synchronize($ids);

General Journal Document Properties

When working with general journal documents, you’ll have access to the following properties:

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the document belongs to
contact_idstringID of the contact associated with the document
referencestringReference or name for the document
datestringDate of the document (YYYY-MM-DD)
entry_numberstringEntry number in the administration
statestringCurrent state of the document
originstringOrigin of the document
detailsarrayLine items or details of the document (debits and credits)
paymentsarrayPayment information
notesarrayNotes attached to the document
attachmentsarrayAttachments linked to the document
eventsarrayEvents related to the document
created_atstringISO 8601 timestamp of when the document was created
updated_atstringISO 8601 timestamp of when the document was last updated

Note: See the official API reference for the complete list of available properties.

Further reading