Skip to content

Sales Invoices

Manage your Sales Invoices in Moneybird.

Working with Sales Invoices

This section covers how to interact with Moneybird’s Sales Invoices API. You can create, retrieve, update, and delete sales invoices, as well as perform various actions such as sending, marking as paid, and duplicating.

Basic Operations

Get a Sales Invoice

Retrieve a sales invoice by its ID.

$salesInvoice = $client->salesInvoices()->get('123456789');

Find a Sales Invoice by Invoice ID

Find a sales invoice using its invoice ID.

$salesInvoice = $client->salesInvoices()->findByInvoiceId('INV-2023-001');

Find a Sales Invoice by Reference

Find a sales invoice using its reference.

$salesInvoice = $client->salesInvoices()->findByReference('Project A');

List Sales Invoices

Get a paginated list of sales invoices.

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

Create a Sales Invoice

Create a new sales invoice.

$data = [
'contact_id' => '123456789',
'reference' => 'INV-2023-001',
'invoice_date' => '2023-01-15',
'due_date' => '2023-02-15',
'currency' => 'EUR',
'discount' => '0',
'prices_are_incl_tax' => true,
'details' => [
[
'description' => 'Web Development Services',
'price' => '100.00',
'amount' => '10',
'tax_rate_id' => '123456'
]
]
];
$salesInvoice = $client->salesInvoices()->create($data);

Update a Sales Invoice

Update an existing sales invoice.

$updateData = [
'reference' => 'INV-2023-001-UPDATED',
'due_date' => '2023-03-01'
];
$salesInvoice = $client->salesInvoices()->update('123456789', $updateData);

Delete a Sales Invoice

Delete a sales invoice.

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

Invoice Actions

Send Email

Send the sales invoice by email.

$salesInvoice = $client->salesInvoices()->sendEmail('123456789');

Get Email Template

Get the email template for a sales invoice.

$emailTemplate = $client->salesInvoices()->getEmailTemplate('123456789');

Send Reminder

Send a reminder for the sales invoice.

$salesInvoice = $client->salesInvoices()->sendReminder('123456789');

Get Reminder Template

Get the reminder template for a sales invoice.

$reminderTemplate = $client->salesInvoices()->getReminderTemplate('123456789');

Send Invoice Reminder

Send an invoice reminder.

$salesInvoice = $client->salesInvoices()->sendInvoiceReminder('123456789');

Send Payment Reminder

Send a payment reminder.

$salesInvoice = $client->salesInvoices()->sendPaymentReminder('123456789');

Send by Post

Send the sales invoice by post.

$salesInvoice = $client->salesInvoices()->sendPost('123456789');

Status Management

Mark as Sent

Mark a sales invoice as sent.

$salesInvoice = $client->salesInvoices()->markAsSent('123456789');

Mark as Accepted

Mark a sales invoice as accepted.

$salesInvoice = $client->salesInvoices()->markAsAccepted('123456789');

Mark as Paid

Mark a sales invoice as paid.

$salesInvoice = $client->salesInvoices()->markAsPaid('123456789');

Mark as Uncollectible

Mark a sales invoice as uncollectible.

$salesInvoice = $client->salesInvoices()->markAsUncollectible('123456789');

Mark as Published

Mark a sales invoice as published.

$salesInvoice = $client->salesInvoices()->markAsPublished('123456789');

Mark as Unpublished

Mark a sales invoice as unpublished.

$salesInvoice = $client->salesInvoices()->markAsUnpublished('123456789');

Invoice Duplication

Duplicate Invoice

Create a duplicate of a sales invoice.

$duplicateInvoice = $client->salesInvoices()->duplicate('123456789');

Duplicate to Credit Invoice

Create a credit invoice from a sales invoice.

$creditInvoice = $client->salesInvoices()->duplicateToCreditInvoice('123456789');

Payments

Delete a Payment

Delete a payment associated with a sales invoice.

$client->salesInvoices()->deletePayment('123456789', 'payment_id');

Access Payments Endpoint

Access the dedicated payments endpoint for a sales invoice.

$paymentsEndpoint = $client->salesInvoices()->payments();

Synchronization

Get Synchronization List

Get a list of sales invoice IDs and version timestamps for synchronization.

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

Synchronize Sales Invoices

Synchronize sales invoices by providing an array of IDs.

$salesInvoiceIds = ['123456789', '987654321'];
$syncedSalesInvoices = $client->salesInvoices()->synchronize($salesInvoiceIds);
foreach ($syncedSalesInvoices as $salesInvoice) {
echo $salesInvoice->reference;
}

Sales Invoice Properties

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

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the sales invoice belongs to
contact_idstringID of the contact associated with the sales invoice
contactarrayContact information
contact_person_idstringID of the contact person
contact_personarrayContact person information
invoice_idstringInvoice ID (formatted ID shown to customers)
recurring_sales_invoice_idstringID of the recurring sales invoice if this was generated from one
subscription_idstringID of the subscription if applicable
workflow_idstringID of the workflow to use for the sales invoice
document_style_idstringID of the document style
identity_idstringID of the identity
draft_idintID of the draft
statestringCurrent state of the sales invoice
invoice_datestringDate of the invoice
due_datestringDue date for payment
payment_conditionsstringPayment conditions text
payment_referencestringPayment reference
short_payment_referencestringShort payment reference
referencestringReference text for the sales invoice
languagestringLanguage code for the invoice
currencystringCurrency code
discountstringDiscount percentage
original_sales_invoice_idstringID of the original sales invoice if this is a duplicate
pausedbooleanWhether the invoice is paused
paid_atstringDate when the invoice was paid
sent_atstringDate when the invoice was sent
created_atstringISO 8601 timestamp of when the sales invoice was created
updated_atstringISO 8601 timestamp of when the sales invoice was last updated
public_view_codestringCode for public view access
public_view_code_expires_atstringExpiration date for public view code
versionintVersion number
detailsarrayLine items on the sales invoice
paymentsarrayPayment information
total_paidstringTotal amount paid
total_unpaidstringTotal amount unpaid
total_unpaid_basestringTotal amount unpaid in base currency
prices_are_incl_taxbooleanWhether prices include tax
total_price_excl_taxstringTotal price excluding tax
total_price_excl_tax_basestringTotal price excluding tax in base currency
total_price_incl_taxstringTotal price including tax
total_price_incl_tax_basestringTotal price including tax in base currency
total_discountstringTotal discount amount
marked_dubious_onstringDate when marked as dubious
marked_uncollectible_onstringDate when marked as uncollectible
reminder_countintNumber of reminders sent
next_reminderstringDate of the next reminder
original_estimate_idstringID of the original estimate if created from one
urlstringURL to view the invoice
payment_urlstringURL for payment
custom_fieldsarrayCustom fields for the sales invoice
notesarrayNotes associated with the sales invoice
attachmentsarrayAttachments associated with the sales invoice
eventsarrayEvents related to the sales invoice
tax_totalsarrayTax totals information

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

Further reading