Skip to content

General Documents

Manage your General Documents in Moneybird.

Working with General Documents

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

Basic Operations

Get a General Document

Retrieve a general document by its ID.

$generalDocument = $client->generalDocuments()->get('123456789');

List General Documents

Get a paginated list of general documents.

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

Get All General Documents

Get all general documents at once.

$allGeneralDocuments = $client->generalDocuments()->all();
// Iterate through all general documents
foreach ($allGeneralDocuments as $generalDocument) {
echo $generalDocument->reference;
}

Create a General Document

Create a new general document.

$data = [
'contact_id' => '123456789',
'reference' => 'Document #2025-001',
'date' => '2025-03-01',
'due_date' => '2025-03-15',
'details_attributes' => [
[
'description' => 'Service rendered',
'amount' => '100.00'
]
]
];
$generalDocument = $client->generalDocuments()->create($data);

Update a General Document

Update an existing general document.

$updateData = [
'reference' => 'Document #2025-001 - Updated',
'due_date' => '2025-03-20'
];
$generalDocument = $client->generalDocuments()->update('123456789', $updateData);

Delete a General Document

Delete a general document.

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

Working with Attachments

Add an Attachment to a General Document

Add an attachment to a general document.

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

Delete an Attachment from a General Document

Delete an attachment from a general document.

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

Specialized Features

Synchronize General Documents

Synchronize a list of general documents by their IDs.

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

General Document Properties

When working with general 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
contact_person_idstringID of the contact person associated with the document
referencestringReference or name for the document
datestringDate of the document (YYYY-MM-DD)
due_datestringDue date of the document (YYYY-MM-DD)
entry_numberstringEntry number in the administration
statestringCurrent state of the document
exchange_ratestringExchange rate if applicable
detailsarrayLine items or details of the document
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