Skip to content

External Sales Invoices

Manage your External Sales Invoices in Moneybird.

Working with External Sales Invoices

This section covers how to interact with Moneybird’s External Sales Invoices API. You can create, retrieve, update, and delete external sales invoices, as well as manage attachments and payments.

Basic Operations

Get an External Sales Invoice

Retrieve an external sales invoice by its ID.

$externalSalesInvoice = $client->externalSalesInvoices()->get('123456789');

List External Sales Invoices

Get a paginated list of external sales invoices.

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

Create an External Sales Invoice

Create a new external sales invoice.

$data = [
'contact_id' => '987654321',
'reference' => 'INV-2025-001',
'date' => '2025-03-01',
'due_date' => '2025-03-15',
'currency' => 'EUR',
'prices_are_incl_tax' => true,
'details_attributes' => [
[
'description' => 'Product A',
'price' => '100.00',
'amount' => '2',
'tax_rate_id' => '123456'
]
]
];
$externalSalesInvoice = $client->externalSalesInvoices()->create($data);

Update an External Sales Invoice

Update an existing external sales invoice.

$updateData = [
'reference' => 'INV-2025-001-UPDATED',
'due_date' => '2025-03-20'
];
$externalSalesInvoice = $client->externalSalesInvoices()->update('123456789', $updateData);

Delete an External Sales Invoice

Delete an external sales invoice.

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

Specialized Features

Synchronize External Sales Invoices

Synchronize a list of external sales invoices by their IDs.

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

Working with Attachments

Access the attachments endpoint for an external sales invoice.

// Get the attachments endpoint
$attachmentsEndpoint = $client->externalSalesInvoices()->attachments();
// Upload an attachment
$attachment = $attachmentsEndpoint->create('123456789', [
'filename' => 'invoice.pdf',
'content' => base64_encode(file_get_contents('path/to/invoice.pdf'))
]);
// Get an attachment
$attachment = $attachmentsEndpoint->get('123456789', 'attachment_id');
// Delete an attachment
$attachmentsEndpoint->delete('123456789', 'attachment_id');

Working with Payments

Access the payments endpoint for an external sales invoice.

// Get the payments endpoint
$paymentsEndpoint = $client->externalSalesInvoices()->payments();
// Create a payment
$payment = $paymentsEndpoint->create('123456789', [
'payment_date' => '2025-03-05',
'price' => '200.00',
'payment_method' => 'bank_transfer'
]);
// Delete a payment
$paymentsEndpoint->delete('123456789', 'payment_id');

External Sales Invoice Properties

When working with external sales invoices, you’ll have access to the following properties:

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the invoice belongs to
contact_idstringID of the contact associated with the invoice
contactarrayContact details
datestringDate of the invoice (YYYY-MM-DD)
statestringCurrent state of the invoice
due_datestringDue date of the invoice (YYYY-MM-DD)
referencestringYour reference for this invoice
entry_numberintegerEntry number in the administration
currencystringCurrency used in the invoice
paid_atstringDate when the invoice was paid
total_paidstringTotal amount paid
total_unpaidstringTotal amount unpaid
prices_are_incl_taxbooleanWhether prices include tax
total_price_excl_taxstringTotal price excluding tax
total_price_incl_taxstringTotal price including tax
detailsarrayLine items on the invoice
paymentsarrayPayment information
notesarrayNotes attached to the invoice
attachmentsarrayAttachments linked to the invoice
created_atstringISO 8601 timestamp of when the invoice was created
updated_atstringISO 8601 timestamp of when the invoice was last updated

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

Further reading