Skip to content

Recurring Sales Invoices

Manage your Recurring Sales Invoices in Moneybird.

Working with Recurring Sales Invoices

This section covers how to interact with Moneybird’s Recurring Sales Invoices API. You can create, retrieve, update, and delete recurring sales invoices, as well as synchronize data.

Basic Operations

Get a Recurring Sales Invoice

Retrieve a recurring sales invoice by its ID.

$recurringSalesInvoice = $client->recurringSalesInvoices()->get('123456789');

List Recurring Sales Invoices

Get a paginated list of recurring sales invoices.

$recurringSalesInvoices = $client->recurringSalesInvoices()->paginate();
// Iterate through the pages
foreach ($recurringSalesInvoices as $recurringSalesInvoice) {
echo $recurringSalesInvoice->reference . ': ' . $recurringSalesInvoice->frequency_type;
}

Get All Recurring Sales Invoices

Get all recurring sales invoices at once.

$allRecurringSalesInvoices = $client->recurringSalesInvoices()->all();
// Iterate through all recurring sales invoices
foreach ($allRecurringSalesInvoices as $recurringSalesInvoice) {
echo $recurringSalesInvoice->reference . ': ' . $recurringSalesInvoice->frequency_type;
}

Create a Recurring Sales Invoice

Create a new recurring sales invoice.

$data = [
'contact_id' => '123456789',
'reference' => 'Monthly Service',
'start_date' => '2023-01-01',
'invoice_period' => 'month',
'invoice_interval' => '1',
'frequency_type' => 'month',
'frequency' => '1',
'workflow_id' => '123456',
'language' => 'en',
'currency' => 'EUR',
'discount' => '0',
'first_due_interval' => '14',
'auto_send' => true,
'sending_method' => 'email',
'details' => [
[
'description' => 'Monthly Service Fee',
'price' => '100.00',
'amount' => '1',
'tax_rate_id' => '123456'
]
]
];
$recurringSalesInvoice = $client->recurringSalesInvoices()->create($data);

Update a Recurring Sales Invoice

Update an existing recurring sales invoice.

$updateData = [
'reference' => 'Monthly Service - Updated',
'frequency' => '2',
'auto_send' => false
];
$recurringSalesInvoice = $client->recurringSalesInvoices()->update('123456789', $updateData);

Delete a Recurring Sales Invoice

Delete a recurring sales invoice.

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

Synchronization

Get Synchronization List

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

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

Synchronize Recurring Sales Invoices

Synchronize recurring sales invoices by providing an array of IDs.

$recurringSalesInvoiceIds = ['123456789', '987654321'];
$syncedRecurringSalesInvoices = $client->recurringSalesInvoices()->synchronize($recurringSalesInvoiceIds);
foreach ($syncedRecurringSalesInvoices as $recurringSalesInvoice) {
echo $recurringSalesInvoice->reference;
}

Recurring Sales Invoice Properties

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

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the recurring sales invoice belongs to
contact_idstringID of the contact associated with the recurring sales invoice
contactstringContact information
workflow_idstringID of the workflow to use for the recurring sales invoice
statestringCurrent state of the recurring sales invoice
start_datestringDate when the recurring sales invoice starts
invoice_periodstringPeriod for which the invoice is valid (e.g., ‘month’, ‘year’)
invoice_intervalstringInterval between invoices
frequency_typestringType of frequency (e.g., ‘month’, ‘week’, ‘year’)
frequencystringHow often the invoice recurs
referencestringReference text for the recurring sales invoice
languagestringLanguage code for the invoice (e.g., ‘en’, ‘nl’)
currencystringCurrency code (e.g., ‘EUR’, ‘USD’)
discountstringDiscount percentage
first_due_intervalstringNumber of days until the first invoice is due
auto_sendbooleanWhether to automatically send the invoice
sending_scheduled_atstringWhen the sending is scheduled
sending_methodstringMethod for sending the invoice (e.g., ‘email’, ‘post’)
detailsarrayLine items on the recurring sales invoice
notesarrayNotes associated with the recurring sales invoice
attachmentsarrayAttachments associated with the recurring sales invoice
custom_fieldsarrayCustom fields for the recurring sales invoice
created_atstringISO 8601 timestamp of when the recurring sales invoice was created
updated_atstringISO 8601 timestamp of when the recurring sales invoice was last updated

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

Further reading