Skip to main content
Factur-X type 381 · EN16931 · ISCA · B2C inherited · Partial/Full

EN16931-compliant credit notes linked to your invoices — automatic inheritance.

POST /credit-notes with invoice_id → Factur-X type 381 credit note, frozen buyer/seller, B2C inherited, ISCA chain. Partial or full. PHP and TypeScript SDK.

$api = ScellApiClient::withApiKey('sk_live_...');

// Avoir total sur une facture existante
$creditNote = $api->creditNotes()->builder()
    ->forInvoice('invoice-uuid')
    ->reason('Retour marchandises — bon état')
    ->lines([
        ['invoice_line_id' => 'line-uuid-1', 'quantity' => 2],
    ])
    ->create();

echo 'Credit note: ' . $creditNote->credit_note_number;
echo 'Amount: '      . $creditNote->total_ttc;

The problem

  • Impossible to maintain buyer/seller consistency — a credit note must exactly reproduce the buyer and seller information from the source invoice. If modified in the meantime (address change, corrected SIRET), the credit note diverges and may be rejected by the client or administration.
  • ISCA chain and tax compliance — a credit note must enter the tax ledger with a distinct sequential number (AVO-YYYY-NNNN), a SHA-256 hash linked to the source invoice's chain. A credit note issued out of sequence creates an audit gap.
  • Strict EN16931 validation — the Factur-X credit note (code 381) has its own BR rules. The buyer_is_individual inherited from the invoice must be propagated. A B2C credit note with SIRET tags creates a Schematron non-compliance.

Our solution

  • POST /credit-notes with invoice_id — Scell automatically snapshots buyer and seller from the source invoice at issuance time. The buyer_* and seller_* columns on the credit note are frozen independently of any subsequent modification to the buyer or company.
  • Automatic B2C inheritance — if the source invoice is buyer_is_individual: true, the credit note automatically inherits this flag. SIRET/VAT/L441-10 tags are removed without configuration, per EN16931 BR-CO-26.
  • Partial or full, selective lines — the lines[] array with invoice_line_id allows a line-by-line partial credit note. Without the lines[] array, the credit note covers the entire invoice. The InvoiceCreditable rule validates the invoice is not already fully credited.

6 credit note guarantees

Strict invoice_id link

The invoice_id field links the credit note to an existing, verified invoice. Complete anti-IDOR: the invoice must belong to the same tenant/sub_tenant. Impossible to create an orphan or cross-tenant credit note.

Guaranteed invoice link

Frozen buyer/seller inheritance

The buyer_* (name, siret, address) and seller_* (company) columns are snapshotted from the source invoice at issuance. No subsequent modification to the buyer or company impacts the already issued credit note.

Immutable ISCA data

Partial by lines (invoice_line_id)

The lines[] array accepts N lines with invoice_line_id + optional quantity. A partial credit note selectively credits. Without lines[], the credit note is total. The InvoiceCreditable rule verifies no over-crediting.

Partial or full in 1 field

B2C automatically inherited

If the source invoice is buyer_is_individual: true, CreditNoteService automatically propagates the flag. BT-46/47/48 tags and L441-10 notices are removed without configuration — BR-CO-26 compliance guaranteed.

B2C inherited without config

PDF/A-3b + XML CII download

Credit note available via GET /credit-notes/{id}/download/{format}. Format pdf (PDF/A-3b), xml (CII only), facturx (full). File stored in WORM S3 with ISCA hash. Accessible via API, signed URL or webhook.

PDF + XML available

Strict validation 422 explicit

The InvoiceCreditable rule checks creditable status (validated, transmitted, accepted, paid), absence of over-crediting, line membership. Each violation returns 422 with the exact error code — no silent corruption.

0 over-crediting possible
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 issue your first Factur-X credit note?

Free sandbox. No credit card. EN16931 compliant credit note in 1 call.

Start for freeView SDKs

Your cookie preferences

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