Invoicing · 04 / 26

Sequence Diagrams

The pertinent flows of the receivables platform as sequence diagrams: invoice run, delivery, cash application, an unmatched payment, a dispute and a dunning step.

How to read them

Each diagram shows one flow across the platform's components, top to bottom in time. Solid arrows are requests, dashed arrows are replies, amber arrows are held, blocked or refused paths and cyan arrows are agent decisions.

ParticipantRole
Billing enginePrices, taxes and assembles invoices deterministically
Review agentChecks invoices against contract terms and drafts notes
Cash applicationMatches payments to open invoices
Dispute agentGathers evidence, retrieves clauses and drafts resolutions
Tool gatewayThe MCP (Model Context Protocol) gateway to enterprise systems, with scopes and audit
Review deskPeople who approve or decide

1 · The nightly invoice run

Nightly invoice run with an anomaly hold The billing run builds invoices from shipped orders, asks the tax engine for tax, prices from contract and validates. The review agent compares each invoice with contract terms, flags anomalies, and flagged invoices are held for a person while the rest are released. Billing run Billing engine Tax engine Review agent Reviewer Delivery 2,140 shipped orders tax for ship-to and items tax lines price from contract, validate anomaly check, draft note retrieve contract terms 2 flags: price over contract hold 2 invoices approve one, correct one release 2,140 invoices
Nightly invoice run with an anomaly hold

Tax and price come from systems. The agent only flags and explains, so a bad flag costs a review, not a wrong invoice.

2 · Delivery and acknowledgement

E-invoice delivery with rejection handling Invoices are sent in each customer's channel. An e-invoice network may reject one for a format error. The delivery service records the status, the billing engine corrects and resends, and the customer portal always shows the invoice. Billing engine Delivery service E-invoice network Customer system Portal invoice INV-81234, format UBL submit rejected: missing buyer reference delivery failed with reason add reference from the order resubmit submit deliver accepted status: accepted publish copy
E-invoice delivery with rejection handling

The rule that fixes the rejection is code. A recurring reason becomes a validation before sending.

3 · Cash application, the clean case

Automatic match of a payment with remittance A bank line arrives. Document AI extracts the remittance lines, the match engine applies rules and scores, and an exact match is applied to the ERP with the evidence and an idempotency key. Bank feed Cash application Document AI Match engine ERP camt.053 line, $48,720.00 extract remittance PDF 7 lines, validated schema match on reference and amount 6 exact, 1 short pay apply 6 invoices + key applied log evidence and trace
Automatic match of a payment with remittance

Rules decide exact matches. The model only reads the document, and its output must validate against a schema.

4 · An unmatched or ambiguous payment

Unmatched payment routed to a clerk A payment has no usable remittance. The match engine scores candidates and none passes the threshold, so the payment is held as unapplied and a ranked list goes to the clerk, who confirms a match. The application is reversible and its evidence is recorded. Cash application Match engine Review desk ERP Audit log payment $12,300.00, no remittance score candidates best score 0.71, below 0.90 unapplied, 3 candidates ranked check bank name and past pattern confirm candidate 1 apply, reversible entry + key applied who, what, evidence
Unmatched payment routed to a clerk

The threshold is a business control. Below it the platform waits for a person, and every confirmation is recorded.

5 · A dispute with evidence

Dispute resolution with evidence and approval A short pay opens a dispute. The dispute agent gathers delivery and claim evidence through the tool gateway, retrieves the governing clause and drafts a resolution. A collector approves the dispute and the credit manager decides on the credit. Dispute agent Tool gateway Clause index Collector Credit manager get order, proof of delivery, claims evidence bundle damage claims, customer scope clause 9.2, five days draft: apply now, dispute $620 draft with evidence approve dispute recommend credit pending carrier claim approve conditional credit post dispute and credit + key
Dispute resolution with evidence and approval

The agent cannot issue a credit. It recommends, and a named person approves within their limit.

6 · A collections step with approval

Collections outreach drafted and approved The risk model ranks overdue accounts. The collections agent drafts a reminder for the top account from open, undisputed invoices. A collector edits and approves it, and it is sent with a link to the portal. Nothing is sent without approval. Risk model Collections agent Collector Customer ERP ranked list, scores with reasons open, undisputed invoices 4 invoices, $31,240.00 draft reminder, neutral tone draft for approval edit, add call note approve send with portal link promise to pay Friday log promise date
Collections outreach drafted and approved

A reminder lists only invoices that are open and not in dispute, taken from the ledger, so it can never claim more than is owed.

Build this for your business

This example is a receivables platform for a distributor, but the same pattern, deterministic financial rules, a governed gateway, runtime security, grounded evidence and measured quality, fits any back-office process that moves money. We can scope a pilot on your own systems.

Book a discovery call