PHP · Track 4 · Tutorial 1 of 4

Send your invoices

Send the month's sales invoices - who they were to, what for, and what's still owed - so every sales figure can be explained.

You will needThe chart from Send your chart of accounts.
By the endSeptember's invoices in BrizoConsol, each with its lines and its status.

1What invoices add

The trial balance says September's sales were 30,000. Invoices say who they were to, what for, and what's still owed. They never change a figure: they explain the figures the trial balance already carries.

Invoices explain the figures; they never change them
Invoices sit behind the figures: they explain the trial balance and never change it.

2Write the invoices

Create invoices.php. Each invoice has an identity of its own - external_id, the one your system uses - a customer, a date, its total, and at least one line naming an account from the chart:

invoices.php

<?php
// invoices.php - sends September's sales invoices.
require __DIR__ . '/brizo.php';

$invoices = [
    [
        'external_id' => 'INV-1001',
        'number' => 'INV-1001',
        'party_name' => 'Harbour Trading Pte Ltd',
        'party_country' => 'Singapore',
        'date' => '2026-09-08',
        'due_date' => '2026-10-08',
        'total' => 10000.00,
        'amount_paid' => 5000.00,
        'amount_due' => 5000.00,
        'lines' => [
            ['line_item_id' => 'INV-1001-1', 'account_code' => '4000', 'description' => 'Office chairs', 'quantity' => 40, 'unit_price' => 250.00, 'amount' => 10000.00],
        ],
    ],
];

$request = written(call('POST', "/organisations/$companyId/invoices", [
    'declarations' => [
        'source_reference' => 'my-ledger',
        'period' => '2026-09',
        'value_basis' => 'company_base',
        'rate_direction' => 'document_to_base',
        'base_currency' => 'SGD',
    ],
    'records' => $invoices,
]));

show('Invoices', $request);

The declarations are the month's: the month the invoices belong to, and the company's currency.

An invoice: a header, and lines that add up to it
An invoice is a header and its lines. The lines, with tax and less any discount, must add up to the total.

3Send them

php invoices.php

Check

Invoices: request 96 - 1 created, 0 updated, 0 unchanged, 0 refused

4Status works itself out

You don't have to send a status. BrizoConsol works it out from the amounts and the due date: nothing owed is PAID; money owed past the due date is OVERDUE; part paid is PARTIAL; the rest is OPEN. If your system marks a document as voided, send that as its status and it reads VOIDED.

5Send the whole month each time

Like the trial balance, invoices are sent month by month. Each send replaces the invoices this source holds for the month, so an invoice you leave out is removed. Send "mode": "merge" instead to add and update without removing anything.

6If an invoice is refused

amount_disagrees_with_totalThe lines, plus tax and less discount, don't come to the total.
account_not_foundA line names an account the chart doesn't hold.
lines_are_requiredThe invoice has no lines.
document_identity_belongs_to_another_sourceAnother source - a connected accounting system, for example - already holds an invoice with that identity.

Each of these refuses one invoice; the others are still stored. A company holds up to 1,000 invoices a month, and an invoice up to 100 lines.

Want more detail? See the documentation