> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# France CTC Flow 2 (B2B Clearance)

Key: `fr-ctc-flow2-v1`

Module: [github.com/invopop/gobl.fr.ctc](https://github.com/invopop/gobl.fr.ctc)

Support for Flow 2 ("facturation") of the French CTC
reform: domestic B2B clearance, applied to invoices
exchanged between two parties identifiable as French
(SIREN or French VAT ID on both sides). Built on the
EU EN16931 CIUS profile (declared as a dependency).

## Sources

* [External Specifications](https://www.impots.gouv.fr/specifications-externes-b2b)

## Scenarios

### bill/invoice

<Accordion title="standard">
  **Filters:**

  * **Types:** `standard`

  **Output:**

  * **Extensions:** `untdid-document-type:380`
</Accordion>

<Accordion title="standard, #self-billed">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`

  **Output:**

  * **Extensions:** `untdid-document-type:389`
</Accordion>

<Accordion title="standard, #factoring">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `factoring`

  **Output:**

  * **Extensions:** `untdid-document-type:393`
</Accordion>

<Accordion title="standard, #self-billed, #factoring">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `factoring`

  **Output:**

  * **Extensions:** `untdid-document-type:501`
</Accordion>

<Accordion title="standard, #prepayment">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `prepayment`

  **Output:**

  * **Extensions:** `untdid-document-type:386`
</Accordion>

<Accordion title="standard, #self-billed, #prepayment">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `prepayment`

  **Output:**

  * **Extensions:** `untdid-document-type:500`
</Accordion>

<Accordion title="corrective">
  **Filters:**

  * **Types:** `corrective`

  **Output:**

  * **Extensions:** `untdid-document-type:384`
</Accordion>

<Accordion title="corrective, #self-billed">
  **Filters:**

  * **Types:** `corrective`
  * **Tags:** `self-billed`

  **Output:**

  * **Extensions:** `untdid-document-type:471`
</Accordion>

<Accordion title="corrective, #factoring">
  **Filters:**

  * **Types:** `corrective`
  * **Tags:** `factoring`

  **Output:**

  * **Extensions:** `untdid-document-type:472`
</Accordion>

<Accordion title="corrective, #self-billed, #factoring">
  **Filters:**

  * **Types:** `corrective`
  * **Tags:** `self-billed`, `factoring`

  **Output:**

  * **Extensions:** `untdid-document-type:473`
</Accordion>

<Accordion title="credit-note">
  **Filters:**

  * **Types:** `credit-note`

  **Output:**

  * **Extensions:** `untdid-document-type:381`
</Accordion>

<Accordion title="credit-note, #self-billed">
  **Filters:**

  * **Types:** `credit-note`
  * **Tags:** `self-billed`

  **Output:**

  * **Extensions:** `untdid-document-type:261`
</Accordion>

<Accordion title="credit-note, #factoring">
  **Filters:**

  * **Types:** `credit-note`
  * **Tags:** `factoring`

  **Output:**

  * **Extensions:** `untdid-document-type:396`
</Accordion>

<Accordion title="credit-note, #self-billed, #factoring">
  **Filters:**

  * **Types:** `credit-note`
  * **Tags:** `self-billed`, `factoring`

  **Output:**

  * **Extensions:** `untdid-document-type:502`
</Accordion>

<Accordion title="credit-note, #prepayment">
  **Filters:**

  * **Types:** `credit-note`
  * **Tags:** `prepayment`

  **Output:**

  * **Extensions:** `untdid-document-type:503`
</Accordion>

## Extensions

### Billing Mode

Code used to describe the billing framework of the invoice. The
billing mode indicates the nature of goods/services and the payment
context.

Code prefixes indicate the invoice nature:

* "B": Goods invoice (Biens)
* "S": Services invoice
* "M": Mixed/dual invoice (goods and services that are not accessory
  to each other)

The numeric suffix indicates the payment type (1=deposit,
2=already paid, 4=final after down payment, 5=subcontractor,
6=co-contractor, 7=e-reporting).

<Accordion title="fr-ctc-billing-mode">
  | Code | Name                                           |
  | ---- | ---------------------------------------------- |
  | `B1` | Goods - Deposit invoice                        |
  | `B2` | Goods - Already paid invoice                   |
  | `B4` | Goods - Final invoice (after down payment)     |
  | `B7` | Goods - E-reporting (VAT already collected)    |
  | `S1` | Services - Deposit invoice                     |
  | `S2` | Services - Already paid invoice                |
  | `S4` | Services - Final invoice (after down payment)  |
  | `S5` | Services - Subcontractor invoice               |
  | `S6` | Services - Co-contractor invoice               |
  | `S7` | Services - E-reporting (VAT already collected) |
  | `M1` | Mixed - Deposit invoice                        |
  | `M2` | Mixed - Already paid invoice                   |
  | `M4` | Mixed - Final invoice (after down payment)     |
</Accordion>

## Validation Rules

<AccordionGroup>
  <Accordion title="bill.Invoice">
    | Field                                                                         | Test                                                                                                                                                                                                                                                       | Validation Code / Message                                                                                                                                                                   |
    | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | <small>Invoice</small>                                                        | <ul class="gobl-test"><li>Can convert to \[EUR]</li></ul>                                                                                                                                                                                                  | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-01`<br />Invoice must be in EUR or provide an exchange rate to EUR                                                                                          |
    | <small>Invoice</small>                                                        | <ul class="gobl-test"><li>Valid invoice code</li></ul>                                                                                                                                                                                                     | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-02`<br />Invoice code (with series, when set) must be 1-35 characters of alphanumerics plus -+\_/ (BR-FR-01/02)                                             |
    | `preceding[*]`                                                                | <ul class="gobl-test"><li>Valid preceding code</li></ul>                                                                                                                                                                                                   | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-03`<br />Invoice preceding code (with series, when set) must be 1-35 characters of alphanumerics plus -+\_/ (BR-FR-01/02)                                   |
    | `preceding`                                                                   | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[384, 471, 472, 473]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-04`<br />Invoice preceding is required for corrective invoices (BR-FR-CO-04)                                                                                |
    | `preceding`                                                                   | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[384, 471, 472, 473]</li><li>Length between 1 and 1</li></ul>                                                                                                                           | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-05`<br />Invoice preceding must contain exactly one reference for corrective invoices (BR-FR-CO-04)                                                         |
    | `preceding`                                                                   | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[261, 381, 396, 502, 503]</li><li class="gobl-test-present">Present</li></ul>                                                                                                           | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-06`<br />Invoice preceding must contain at least one reference for credit notes (BR-FR-CO-05)                                                               |
    | `tax`                                                                         | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                                                                                                                                                                      | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-07`<br />Invoice tax is required                                                                                                                            |
    | `tax.ext`                                                                     | <ul class="gobl-test"><li>Ext 'untdid-document-type' in \[380, 389, 393, 501, 386, 500, 384, 471, 472, 473, 381, 261, 396, 502, 503, 262]</li></ul>                                                                                                        | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-08`<br />Invoice tax ext untdid-document-type must be a valid Flow 2 document type (BR-FR-04)                                                               |
    | `tax.ext`                                                                     | <ul class="gobl-test"><li>Ext require \[fr-ctc-billing-mode]</li></ul>                                                                                                                                                                                     | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-09`<br />Invoice tax ext fr-ctc-billing-mode is required                                                                                                    |
    | `tax.ext`                                                                     | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B4, S4, M4]</li><li>Ext 'untdid-document-type' not in \[386, 500, 503]</li></ul>                                                                                                        | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-10`<br />Invoice tax ext untdid-document-type must not be an advance-payment code (386, 500, 503) when billing mode is factoring (B4, S4, M4) (BR-FR-CO-08) |
    | `supplier.inboxes`                                                            | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                                                                                                                                                                      | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-11`<br />Invoice supplier inboxes are required for French B2B invoices (BR-FR-13)                                                                           |
    | `supplier.identities`                                                         | <ul class="gobl-test"><li>Has SIREN (legal scope)</li></ul>                                                                                                                                                                                                | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-12`<br />Invoice supplier identities must include a SIREN identity with iso-scheme-id 0002 and scope legal (BR-FR-10/11)                                    |
    | `supplier`                                                                    | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type not in \[389, 501, 500, 471, 473, 261, 502]</li><li>Has SIREN inbox</li></ul>                                                                                                               | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-13`<br />Invoice supplier must have an inbox with scheme 0225 matching the SIREN code (BR-FR-21/22)                                                         |
    | `customer.inboxes`                                                            | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                                                                                                                                                                      | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-14`<br />Invoice customer inboxes are required for French B2B invoices (BR-FR-13)                                                                           |
    | `customer.identities`                                                         | <ul class="gobl-test"><li>Has SIREN (legal scope)</li></ul>                                                                                                                                                                                                | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-15`<br />Invoice customer identities must include a SIREN identity with iso-scheme-id 0002 and scope legal (BR-FR-10/11)                                    |
    | `customer`                                                                    | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[389, 501, 500, 471, 473, 261, 502]</li><li>Has SIREN inbox</li></ul>                                                                                                                   | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-16`<br />Invoice customer must have an inbox with scheme 0225 matching the SIREN code (BR-FR-21/22)                                                         |
    | `ordering.identities`                                                         | <ul class="gobl-test"><li>Identities have at most one ext untdid-reference=AFL</li></ul>                                                                                                                                                                   | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-17`<br />Invoice ordering identities must not contain more than one entry with UNTDID reference 'AFL' (BR-FR-30)                                            |
    | `ordering.identities`                                                         | <ul class="gobl-test"><li>Identities have at most one ext untdid-reference=AWW</li></ul>                                                                                                                                                                   | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-18`<br />Invoice ordering identities must not contain more than one entry with UNTDID reference 'AWW' (BR-FR-30)                                            |
    | `ordering`                                                                    | <ul class="gobl-test"><li>Invoice supplier is under STC scheme</li><li class="gobl-test-present">Present</li></ul>                                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-19`<br />Invoice ordering is required when supplier is under STC scheme (BR-FR-CO-15)                                                                       |
    | `ordering.seller`                                                             | <ul class="gobl-test"><li>Invoice supplier is under STC scheme</li><li class="gobl-test-present">Present</li></ul>                                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-20`<br />Invoice ordering seller is required when supplier is under STC scheme (BR-FR-CO-15)                                                                |
    | `ordering.seller.tax_id`                                                      | <ul class="gobl-test"><li>Invoice supplier is under STC scheme</li><li class="gobl-test-present">Present</li></ul>                                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-21`<br />Invoice ordering seller tax\_id is required when supplier is under STC scheme (BR-FR-CO-15)                                                        |
    | `ordering.seller.tax_id.code`                                                 | <ul class="gobl-test"><li>Invoice supplier is under STC scheme</li><li class="gobl-test-present">Present</li></ul>                                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-22`<br />Invoice ordering seller tax\_id code is required when supplier is under STC scheme (BR-FR-CO-15)                                                   |
    | `notes`                                                                       | <ul class="gobl-test"><li>Invoice supplier is under STC scheme</li><li>Has TXD note</li></ul>                                                                                                                                                              | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-23`<br />Invoice notes must include an entry with subject TXD and text MEMBRE\_ASSUJETTI\_UNIQUE when supplier is under STC scheme (BR-FR-CO-14)            |
    | `ordering`                                                                    | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[262]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                               | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-24`<br />Invoice ordering is required for consolidated credit notes (BR-FR-CO-03)                                                                           |
    | `ordering.contracts`                                                          | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[262]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                               | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-25`<br />Invoice ordering contracts is required for consolidated credit notes (BR-FR-CO-03)                                                                 |
    | `ordering.contracts`                                                          | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[262]</li><li>Length between 1 and 0</li></ul>                                                                                                                                          | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-26`<br />Invoice ordering contracts must contain at least one entry for consolidated credit notes (BR-FR-CO-03)                                             |
    | `delivery`                                                                    | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[262]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                               | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-27`<br />Invoice delivery is required for consolidated credit notes (BR-FR-CO-03)                                                                           |
    | `delivery.period`                                                             | <ul class="gobl-test"><li>Invoice tax ext untdid-document-type in \[262]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                               | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-28`<br />Invoice delivery period is required for consolidated credit notes (BR-FR-CO-03)                                                                    |
    | <small>Invoice</small>                                                        | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode not in \[B2, S2, M2]</li><li>Due dates valid</li></ul>                                                                                                                                       | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-29`<br />Invoice payment terms due\_dates must not be before the invoice issue date (BR-FR-CO-07)                                                           |
    | `payment`                                                                     | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B2, S2, M2]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-30`<br />Invoice payment is required for final invoices (BR-FR-CO-09)                                                                                       |
    | `payment.terms`                                                               | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B2, S2, M2]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-31`<br />Invoice payment terms is required for final invoices (BR-FR-CO-09)                                                                                 |
    | `payment.terms.due_dates`                                                     | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B2, S2, M2]</li><li class="gobl-test-present">Present</li></ul>                                                                                                                         | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-32`<br />Invoice payment terms due\_dates must contain at least one entry for final invoices (BR-FR-CO-09)                                                  |
    | `totals`<br /><small class="gobl-field-calculated">Calculated</small>         | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B2, S2, M2]</li><li>Advances match total\_with\_tax</li></ul>                                                                                                                           | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-34`<br />Invoice totals advance must equal total\_with\_tax for final invoices (BR-FR-CO-09)                                                                |
    | `totals`<br /><small class="gobl-field-calculated">Calculated</small>         | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B2, S2, M2]</li><li>Payable is zero</li></ul>                                                                                                                                           | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-35`<br />Invoice totals payable must be zero for final invoices (BR-FR-CO-09)                                                                               |
    | `totals.advance`<br /><small class="gobl-field-calculated">Calculated</small> | <ul class="gobl-test"><li>Invoice tax ext fr-ctc-billing-mode in \[B2, S2, M2]</li><li>Present</li></ul>                                                                                                                                                   | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-33`<br />Invoice totals advance is required for final invoices (BR-FR-CO-09)                                                                                |
    | `notes`                                                                       | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                                                                                                                                                                      | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-36`<br />Invoice notes are required for French CTC invoices (BR-FR-05)                                                                                      |
    | `notes`                                                                       | <ul class="gobl-test"><li>Has required note subjects</li></ul>                                                                                                                                                                                             | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-37`<br />Invoice notes must include entries with subjects PMT, PMD and AAB (BR-FR-05)                                                                       |
    | `notes`                                                                       | <ul class="gobl-test"><li>No duplicate note subjects</li></ul>                                                                                                                                                                                             | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-38`<br />Invoice notes must not contain duplicate subjects PMT, PMD, AAB or TXD (BR-FR-06/BR-FR-30)                                                         |
    | `attachments`                                                                 | <ul class="gobl-test"><li>At most one LISIBLE</li></ul>                                                                                                                                                                                                    | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-41`<br />Invoice attachments must not contain more than one entry with description 'LISIBLE' (BR-FR-18)                                                     |
    | `attachments[*].description`                                                  | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                                                                                                                                                                      | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-39`<br />Invoice attachment description is required (BR-FR-17)                                                                                              |
    | `attachments[*].description`                                                  | <ul class="gobl-test"><li>One of \[RIB, LISIBLE, FEUILLE\_DE\_STYLE, PJA, BON\_LIVRAISON, BON\_COMMANDE, DOCUMENT\_ANNEXE, BORDEREAU\_SUIVI, BORDEREAU\_SUIVI\_VALIDATION, ETAT\_ACOMPTE, FACTURE\_PAIEMENT\_DIRECT, RECAPITULATIF\_COTRAITANCE]</li></ul> | `GOBL-FR-CTC-FLOW2-BILL-INVOICE-40`<br />Invoice attachment description must be one of the allowed values (BR-FR-17)                                                                        |
  </Accordion>

  <Accordion title="org.Party">
    | Field        | Test                                                     | Validation Code / Message                                                            |
    | ------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------ |
    | `identities` | <ul class="gobl-test"><li>SIRET/SIREN coherent</li></ul> | `GOBL-FR-CTC-FLOW2-ORG-PARTY-01`<br />SIRET and SIREN must be coherent (BR-FR-09/10) |
    | `identities` | <ul class="gobl-test"><li>Valid scheme format</li></ul>  | `GOBL-FR-CTC-FLOW2-ORG-PARTY-02`<br />Identity scheme format invalid (BR-FR-CO-10)   |
    | `inboxes[*]` | <ul class="gobl-test"><li>Valid inbox</li></ul>          | `GOBL-FR-CTC-FLOW2-ORG-PARTY-03`<br />Inbox code format invalid                      |
  </Accordion>

  <Accordion title="org.Identity">
    | Field  | Test                                                                                  | Validation Code / Message                                                         |
    | ------ | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
    | `code` | <ul class="gobl-test"><li>Scheme 0224</li><li>Length between 0 and 100</li></ul>      | `GOBL-FR-CTC-FLOW2-ORG-IDENTITY-01`<br />Must be no more than 100 characters long |
    | `code` | <ul class="gobl-test"><li>Scheme 0224</li><li>Matches ^\[A-Za-z0-9-+\_/]+\$</li></ul> | `GOBL-FR-CTC-FLOW2-ORG-IDENTITY-02`<br />Must be in a valid format                |
  </Accordion>

  <Accordion title="org.Inbox">
    | Field  | Test                                                                                  | Validation Code / Message                                                  |
    | ------ | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
    | `code` | <ul class="gobl-test"><li>Scheme 0225</li><li>Length between 0 and 125</li></ul>      | `GOBL-FR-CTC-FLOW2-ORG-INBOX-01`<br />The length must be between 0 and 125 |
    | `code` | <ul class="gobl-test"><li>Scheme 0225</li><li>Matches ^\[A-Za-z0-9-+\_/]+\$</li></ul> | `GOBL-FR-CTC-FLOW2-ORG-INBOX-02`<br />Must be in a valid format            |
  </Accordion>

  <Accordion title="org.Item">
    | Field  | Test                                              | Validation Code / Message                                                   |
    | ------ | ------------------------------------------------- | --------------------------------------------------------------------------- |
    | `meta` | <ul class="gobl-test"><li>No blank meta</li></ul> | `GOBL-FR-CTC-FLOW2-ORG-ITEM-01`<br />Meta values cannot be blank (BR-FR-28) |
  </Accordion>
</AccordionGroup>
