Skip to main content
Factur-X type 380 · auto BG-22 · parent_invoice_ids

Factur-X balance invoice — BG-22 deduction automatically calculated.

Balance = quote total - sum of deposits. Calculated and written in XML. Type 380, BG-22, deposit reference parent_invoice_ids. Zero manual recalculation.

$balance = $api->quotes()->convertToBalance('quote-uuid', [
    'due_date' => '2026-07-10',
]);

echo 'Balance invoice: ' . $balance->invoice_number;
echo 'Remaining to pay: ' . $balance->total_ttc;
echo 'References deposits: ' . json_encode($balance->parent_invoice_ids);

The problem

  • Missing or malformed BG-22 — without the "Preceding Invoice Reference" section, the recipient doesn't know VAT was partially already paid. Possible rejection at tax audit.
  • Double VAT invoicing — if VAT is recalculated on the quote total instead of the residual, the client pays VAT twice. Major accounting error, likely tax audit adjustment.
  • Manual balance calculation — referencing N deposits with their respective pre-tax amounts manually is error-prone. No consumer tool automates BG-22.

Our solution

  • Automatic BG-22 generation — convertToBalance reads parent_invoice_ids and builds the BG-22 section with exact references for each deposit. FNFE schematron validation guaranteed.
  • Balance = quote total − sum of deposits — automatic calculation, VAT only on residual. 0 double invoicing, 0 client-side recalculation.
  • Type 380 + continuous ISCA chain — the invoice enters the SHA-256 chain with contiguous sequence_number. Full cycle quote → deposits → balance traced and verifiable.

6 type 380 guarantees

Automatic balance calculation

quote_total - sum(deposits) calculated without intervention. Scell reads parent_invoice_ids and does the arithmetic. 0 accounting errors, 0 manual recalculation.

0 accounting error

EN16931-compliant BG-22

The BG-22 tag group (Preceding Invoice Reference) is automatically generated with exact references of each deposit. FNFE schematron validation guaranteed.

0 FNFE rejection

Type 380 (Final invoice)

Clear distinction deposit (386) / balance (380) in EDI. Transparent client accounting. invoiceTypeCode correctly positioned in CII XML.

Clear client accounting

Cross-reference parent_invoice_ids

Each deposit cited individually in the BG-22 section of the balance. 30-second audit: a single endpoint to see the complete cycle (quote → deposits → balance).

30-second audit

Continuous ISCA chain

The balance enters the same SHA-256 chain as the quote and deposits. Contiguous sequence_number. Full cycle integrity verifiable via /fiscal/integrity.

Full cycle integrity

Compatible buyer registry

The balance invoice inherits the buyer_id snapshotted at issuance. Buyer data is frozen — modifying the buyers registry does not impact issued documents.

Frozen buyer data
Hébergé en FranceScaleway Paris
RGPDDonnées FR
Factur-X conformeDGFiP EN16931
eIDAS SESRègl. 910/2014
ISCA SHA-256Ledger immuable
TLS 1.3Chiffrement bout-à-bout

Frequently asked questions

Ready to close your first deposit/balance cycle?

Free sandbox. No credit card required. BG-22 calculated in 1 call.

Start for freeView SDKs

Your cookie preferences

We use cookies to improve your experience. Essential cookies are always active. Cookie policy.