Skip to content

Receipts

Manage your Receipts in Moneybird.

Working with Receipts

This section covers how to interact with Moneybird’s Receipts API. You can create, retrieve, update, and delete receipts, as well as manage attachments and synchronize data.

Basic Operations

Get a Receipt

Retrieve a receipt by its ID.

$receipt = $client->receipts()->get('123456789');

List Receipts

Get a paginated list of receipts.

$receipts = $client->receipts()->paginate();
// Iterate through the pages
foreach ($receipts as $receipt) {
echo $receipt->reference . ': ' . $receipt->total_price_incl_tax;
}

Get All Receipts

Get all receipts at once.

$allReceipts = $client->receipts()->all();
// Iterate through all receipts
foreach ($allReceipts as $receipt) {
echo $receipt->reference . ': ' . $receipt->total_price_incl_tax;
}

Create a Receipt

Create a new receipt.

$data = [
'contact_id' => '123456789',
'reference' => 'RCPT-2023-001',
'date' => '2023-01-15',
'currency' => 'EUR',
'prices_are_incl_tax' => true,
'details' => [
[
'description' => 'Office Supplies',
'price' => '50.00',
'amount' => '1',
'tax_rate_id' => '123456'
]
]
];
$receipt = $client->receipts()->create($data);

Update a Receipt

Update an existing receipt.

$updateData = [
'reference' => 'RCPT-2023-001-UPDATED',
'date' => '2023-01-20'
];
$receipt = $client->receipts()->update('123456789', $updateData);

Delete a Receipt

Delete a receipt.

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

Attachments

Add an Attachment

Add an attachment to a receipt.

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

Delete an Attachment

Delete an attachment from a receipt.

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

Synchronization

Get Synchronization List

Get a list of receipt IDs and version timestamps for synchronization.

$syncList = $client->receipts()->synchronization();
foreach ($syncList as $item) {
echo $item->id . ' (version: ' . $item->version . ')';
}

Synchronize Receipts

Synchronize receipts by providing an array of IDs.

$receiptIds = ['123456789', '987654321'];
$syncedReceipts = $client->receipts()->synchronize($receiptIds);
foreach ($syncedReceipts as $receipt) {
echo $receipt->reference;
}

Receipt Properties

When working with receipts, you’ll have access to the following properties:

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the receipt belongs to
contact_idstringID of the contact associated with the receipt
referencestringReference number or code for the receipt
datestringDate of the receipt
due_datestringDue date for payment
entry_numberstringEntry number in the system
statestringCurrent state of the receipt
currencystringCurrency code (e.g., ‘EUR’, ‘USD’)
exchange_ratestringExchange rate if not using the default currency
prices_are_incl_taxstringWhether prices include tax
originstringOrigin of the receipt
paid_atstringDate when the receipt was paid
total_price_excl_taxstringTotal price excluding tax
total_price_incl_taxstringTotal price including tax
detailsarrayLine items on the receipt
paymentsarrayPayment information
notesarrayNotes associated with the receipt
attachmentsarrayAttachments associated with the receipt
eventsarrayEvents related to the receipt
created_atstringISO 8601 timestamp of when the receipt was created
updated_atstringISO 8601 timestamp of when the receipt was last updated

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

Further reading