Accounting Sync

Push a client, an invoice or a credit note to the connected accounting
system, and pull reference data the other way.

When a send is refused

A send that cannot start answers a 4xx carrying both a stable
reasonToken and a reasonMessage written to be shown. Branch on the
token and use it as the i18n lookup key.

reasonTokenStatusWhat it means
accounting_not_linked400No accounting system is connected. Connect one first.
connection_not_callable400One is connected but not usable yet. Finish or repair it.
accounting_send_in_flight400The same document is already on its way.
accounting_document_not_sent400Nothing has reached the accounting system, so there is nothing there to act on.
document_not_found404The document does not exist.

Treat an unrecognised token as a generic refusal and show
reasonMessage — the list grows.

Reading reference data

listProviderTaxRates, listProviderAccountCodes and
listProviderContacts carry connected, and notConnectedReason
when it is false. An empty items with connected: false means the
accounting system was never asked, not that it holds nothing.