Zum Inhalt

France API-Integration

Diese Seite richtet sich an Integratoren, die ein ERP oder Middleware über die öffentliche API (/api/v2/..., Header x-api-key) an xTool anbinden.

Die France-Konfiguration (Annuaire-/QAS-Registrierung, Unternehmenskennungen, Tax-Report-Modus) wird nur in der Web-UI verwaltet. Es gibt keinen öffentlichen Endpunkt /api/v2/france/.... Sobald die Konfiguration Active ist, laufen Rechnungsaustausch, Zahlungen und Tax-Report-Abrufe über die normalen Document-/Transaction-/Payment-APIs.

Verwandte Seiten:


Integrationsmodell

France-API-Arbeit basiert auf den normalen xTool-Entitäten. Verwenden Sie die genauen Namen unten — sie entsprechen den API-Ressourcen.

Entität API-Ressource Legen Sie an? Rolle
Document /api/v2/documents Ja (Upload) oder xTool (Inbound) Rechnungs-/Gutschriftsinhalt
Transaction /api/v2/transactions Indirekt über send, oder xTool beim Empfang Ein Kanalversuch: send.france oder receive.france
Transaction Event /api/v2/transaction-events Nein Unveränderlicher Historie-Eintrag einer Transaktion (prepare, send, receive, approved, …)
Transaction Event File /api/v2/transaction-event-files/.../download Nein Binäranhang eines Transaction Events (XML-Payload, Bestätigung, …)
Transaction Action /api/v2/transactions/{id}/actions Ja (Käufer) Befehl auf einer receive.france-Transaktion (acknowledge / approve / partially approve / dispute / refuse)
Payment /api/v2/payments Ja Geldbewegung + Zuordnungen zu Dokumenten
Tax report /api/v2/tax-reports Nein Nur lesbarer regulatorischer Bericht von xTool

Objektmodell:

flowchart TD
    Document --> Transaction
    Transaction --> Events["Transaction Event[]"]
    Events --> Files["Transaction Event File[]"]
    Transaction --> Actions["Transaction Action[]"]
  • Transaction-Typ: send.france oder receive.france
  • Actions: Käufer-Lifecycle + payment_sent bei receive.france; payment_received bei send.france

Transaction Action ≠ Transaction Event.
Sie senden eine Transaction Action per POST. Bei Käufer-Lifecycle-Actions speichert xTool ein passendes Transaction Event (z. B. Action france.invoice.approve → Event france.invoice.approved). Action france.invoice.payment_sent (receive.france) markiert die Zahlung als übermittelt. Action france.invoice.payment_received (send.france) legt ein Payment mit Zuordnung zum Dokument an (wie POST /api/v2/payments). Bei B2B Inland entsprechen diese CDV-Lifecycle-Codes (siehe unten); bei B2C und B2B grenzüberschreitend gilt CDV möglicherweise nicht.

Siehe auch Transaktionen.


Transaction, Events, Actions und Files

Dieser Abschnitt beschreibt das zentrale Objektmodell für den France-Lebenszyklus.

Transaction

Eine Transaction ist ein Send- oder Empfangsversuch für ein Dokument auf einem Kanal.

Feld (API) Hinweise
id Transaction-UUID — fürs Polling speichern
document_id Eltern-Dokument
type send.france oder receive.france
status Lebenszyklus des Versuchs (initialprocessingcompleted / failed)
metadata Client-sichere France-Felder wie invoice_state (keine internen Provider-IDs)
status_log Optional über include=status_log
events Optional über include=events (verschachtelte Events inkl. Files)
actions Optional über include=actions
1
2
3
GET /api/v2/transactions/{transaction_id}?include=events&include=actions&include=status_log
GET /api/v2/transactions?document_id={document_id}
GET /api/v2/transactions?transaction_type=receive.france

Ein Dokument kann mehrere Transactions haben (Resend, Empfang, andere Kanäle). Folgen Sie immer der konkreten France-Transaction.

Transaction Event

Ein Transaction Event ist ein historischer Eintrag zu etwas, das auf dieser Transaction bereits geschehen ist. Clients legen Events nicht an.

Feld (API) Hinweise
id Event-UUID
transaction_id Eltern-Transaction (bei Get-by-ID / Liste)
type Event-Typ-String (siehe Tabelle unten)
metadata Optionale event-spezifische Daten
files Verschachtelte Transaction Event File-Einträge, wenn geladen
created_at / updated_at Zeitstempel
GET /api/v2/transactions/{transaction_id}/events
GET /api/v2/transaction-events/{transaction_event_id}

include=events beim Transaction-Get lädt auch verschachtelte Event-Files.

France Transaction-Event-Typen

type Typische Bedeutung
france.invoice.prepare Rechnung für den Provider aufbereitet / validiert
france.invoice.send An den France-Kanal übermittelt (Outbound)
france.invoice.receive Eingehende Rechnung vom Kanal empfangen
france.invoice.acknowledged Käufer hat die Rechnung zur Kenntnis genommen (CDV 204)
france.invoice.approved Käufer hat die Rechnung vollständig genehmigt (CDV 205)
france.invoice.partially_approved Käufer hat die Rechnung teilweise genehmigt (CDV 206)
france.invoice.disputed Käufer hat die Rechnung angefochten (CDV 207)
france.invoice.suspended Käufer hat die Bearbeitung ausgesetzt (CDV 208; Kanal/CDAR)
france.invoice.completed Verkäufer hat nach Aussetzung ergänzt (CDV 209; Kanal/CDAR)
france.invoice.refused Käufer hat die Rechnung abgelehnt (CDV 210)
france.invoice.payment_sent Käufer hat Zahlung als gesendet markiert (CDV 211; receive.france)
france.invoice.payment_received Verkäufer hat Zahlungseingang erfasst (CDV 212; send.france)
france.tax_report.send Tax Report übermittelt
france.tax_report.acknowledged Tax Report bestätigt
france.tax_report.registered Tax Report registriert

CDV-Codes (204–212) stammen aus dem Inland-B2B-Lifecycle (CDAR / AFNOR XP Z12-012). Sie gelten für B2B Inland. B2C und B2B grenzüberschreitend nutzen andere Meldewege und erzeugen diese CDV-Lifecycle-Codes möglicherweise nicht; xTool speichert trotzdem dieselben Transaction-Event-Typen, wenn der Kanal den entsprechenden Status meldet.

Der Zeitpunkt hängt vom Szenario (Inland vs. grenzüberschreitend) und der Provider-Verarbeitung ab. Nur neue Event-IDs verarbeiten.

Wenn der Kanal für B2B Inland eine Lifecycle-Notification (CDAR / ApplicationResponse) liefert, bevorzugt xTool den CDV-Code aus dem XML (ProcessConditionCode / ResponseCode) gegenüber dem Provider-state der Rechnung. So lassen sich z. B. volle Freigabe (205) und Teilfreigabe (206) unterscheiden.

Transaction Event File

Ein Transaction Event File ist eine gespeicherte Datei an einem Transaction Event (z. B. gesendetes/empfangenes Rechnungs-XML oder eine zugehörige Bestätigung).

Feld (API) Hinweise
id File-UUID — nötig für den Download
filename Original-/Speichername
content_type MIME-Typ
created_at Zeitstempel

Files erscheinen verschachtelt unter Events, wenn Sie Events listen/abrufen. Inhalt separat herunterladen:

GET /api/v2/transaction-event-files/{transaction_event_file_id}/download

Typischer Ablauf:

  1. Transaction mit include=events pollen
  2. Interessierendes Event finden (z. B. france.invoice.receive oder france.invoice.send)
  3. files[].id / filename / content_type lesen
  4. Benötigte Dateien per ID herunterladen

Es gibt kein Create/Update/Delete von Event Files über die öffentliche Client-API.

Transaction Action

Eine Transaction Action ist ein Befehl, den Sie xTool für eine bestehende Transaction ausführen lassen. France-Käufer-Actions gibt es heute nur auf receive.france.

Feld (API) Hinweise
id Action-UUID
transaction_id Eltern-Transaction
type Käufer-Lifecycle-Action, france.invoice.payment_sent oder france.invoice.payment_received
parameters Action-Payload (z. B. reason / amount)
status initialprocessingcompleted / failed
created_at Zeitstempel
GET /api/v2/transactions/{transaction_id}/actions
POST /api/v2/transactions/{transaction_id}/actions

Es gibt keinen Get-by-ID-Endpunkt für eine einzelne Action. Nutzen Sie die Liste oder include=actions beim Transaction-Get.

CDV-Codes → Actions (B2B Inland)

CDV-Codes gelten nur für B2B Inland (CDAR / AFNOR XP Z12-012). Bei B2C und B2B grenzüberschreitend gelten sie möglicherweise nicht. Codes ohne Action meldet nur der Kanal.

CDV Bezeichnung Action type Event type Transaction
204 Prise en charge france.invoice.acknowledge france.invoice.acknowledged receive.france
205 Approuvée france.invoice.approve france.invoice.approved receive.france
206 Approuvée partiellement france.invoice.partially_approve france.invoice.partially_approved receive.france
207 En litige france.invoice.dispute france.invoice.disputed receive.france
208 Suspendue — (nur Kanal) france.invoice.suspended beide
209 Complétée — (nur Kanal) france.invoice.completed beide
210 Refusée france.invoice.refuse france.invoice.refused receive.france
211 Paiement transmis france.invoice.payment_sent france.invoice.payment_sent receive.france
212 Encaissée france.invoice.payment_received france.invoice.payment_received send.france

Frühere Kanalstatus wie 200 (Déposée), 202 (Reçue) und 203 (Mise à disposition) sind ebenfalls B2B-Inland-CDV-Codes; xTool stellt dafür keine Client-Actions bereit.

France Action-Typen → resultierende Events

Action type Body Ergebnis
france.invoice.acknowledge { "type": "france.invoice.acknowledge" } Event france.invoice.acknowledged
france.invoice.approve { "type": "france.invoice.approve" } Event france.invoice.approved
france.invoice.partially_approve { "type": "france.invoice.partially_approve", "amount": "...", "reason": "..." } (amount_code optional, Default MAPTTC) Event france.invoice.partially_approved
france.invoice.dispute { "type": "france.invoice.dispute", "reason": "..." } Event france.invoice.disputed
france.invoice.refuse { "type": "france.invoice.refuse", "reason": "..." } (reason Pflicht; reason_code optional) Event france.invoice.refused
france.invoice.payment_sent { "type": "france.invoice.payment_sent" } (nur receive.france) Event france.invoice.payment_sent
france.invoice.payment_received { "type": "france.invoice.payment_received" } (optional amount / currency / paid_at; nur send.france) Erstellt ein Payment mit Zuordnung zum Dokument; Event france.invoice.payment_received (nach Kanal-Notification)

Regeln:

  • Dieselbe Lifecycle-Action zweimal für eine Transaction → Konflikt (409)
  • Auf Action-status completed / failed und das passende Event warten
  • Payment sent (receive.france) aktualisiert nur den Kanalstatus; es wird kein Payment erstellt
  • Payment received (send.france) erstellt das Payment sofort und synchronisiert zum Provider

Authentifizierung und Organisationskontext

x-api-key: <your-api-key>

Der API-Schlüssel ist an eine Organisation gebunden. Alle sichtbaren Dokumente, Transaktionen, Zahlungen und Steuerberichte gehören zu dieser Organisation.

Checkliste:

  1. API-Schlüssel in der Web-UI mit Berechtigung zum Versand über Frankreich anlegen (sowie Leserechte für Dokumente / Transaktionen / Zahlungen nach Bedarf).
  2. /api/v2/... mit diesem Schlüssel aufrufen.
  3. Sicherstellen, dass die Organisation mindestens eine Active France-Konfiguration hat (Web-UI → Channels → France).

France-Konfiguration und welcher Account sendet

Die France-Konfiguration wird nicht im Send-Request-Body gewählt. Bei send.france macht xTool Folgendes:

  1. Organisation des Dokuments nehmen
  2. Active France-Konfigurationen dieser Organisation laden (mit Provider-Account-ID)
  3. Sender des Dokuments (metadata.sender_id, typischerweise Supplier-Endpoint / SIREN) mit siren / siret / cin_value der Konfiguration matchen
  4. Ohne Treffer: Fallback auf die erste Active-Konfiguration mit Account

Praxisregeln:

  • Verkäufer-Kennungen in der Rechnung so setzen, dass sie zur gewünschten Konfiguration passen
  • Eine Organisation kann mehrere France-Konfigurationen haben (z. B. zwei QAS-Unternehmen für Send/Receive-Tests)
  • Empfangs-only-Modus (annuaire_only) kann keine Rechnungen senden

Der Konfigurationslebenszyklus (NEW → … → DIRECTORY_PENDING / SCHEDULEDACTIVE) läuft über Web + Hintergrundjobs. API-Austausch erfordert Active.


Formate

Bevorzugt für France-Kanal-Tests und produktionsnahe Abläufe:

Formatcode Syntax Hinweise
france_cius.invoice.1_0.xml_ubl.en16931 UBL France-CIUS-Rechnung
france_cius.invoice.1_0.xml_cii.en16931 CII France-CIUS-Rechnung
france_cius.credit_note.1_0.xml_ubl UBL France-CIUS-Gutschrift
peppol_bis_billing_france.invoice.3_0.xml_ubl UBL Peppol BIS Billing France Rechnung (explizit)
peppol_bis_billing_france.credit_note.3_0.xml_ubl UBL Peppol BIS Billing France Gutschrift (explizit)
xtool.invoice.1_0 JSON Internes Modell; konvertierbar / mappbar
xtool.credit_note.1_0 JSON Interne Gutschrift

France-CIUS-Modelle benötigen Frankreich-Felder wie document.profile_id (Billing-Modus, z. B. S1).

Inland-B2B-Versand erwartet typischerweise EUR, eine ausreichend kurze Rechnungsnummer und wo nötig eine französische Käufer-Routing-ID (PIN / Endpoint). Validierungsfehler treten vor oder während Prepare auf.

Upload-Optionen:

1
2
3
POST /api/v2/documents/upload/xml?direction=outbound&require_valid=true
Content-Type: application/xml
x-api-key: <your-api-key>
1
2
3
POST /api/v2/documents/upload/model?direction=outbound&require_valid=true
Content-Type: application/json
x-api-key: <your-api-key>

Die zurückgegebene Dokument-id behalten.

Beispiel France CIUS UBL (Test)

Diesen Body für POST /api/v2/documents/upload/xml?direction=outbound&require_valid=true in der xTool-Testumgebung verwenden, danach POST .../send mit { "transaction_type": "send.france" }.

Vor dem Upload:

  1. Verkäufer-SIREN 256685928 durch die SIREN Ihrer Active France-Konfiguration ersetzen (QAS-Nummer aus dem Chorus-Pro-Datensatz — siehe Testumgebung).
  2. Käufer-SIREN 346628948 durch eine weitere QAS-Firma ersetzen, die ebenfalls als Empfänger registriert / Active ist (zweite France-Konfiguration oder Gegenpartei in QAS).
  3. EndpointID, PartyLegalEntity/CompanyID und VAT-CompanyID (FR… + SIREN) an diese Nummern anpassen.
  4. Für jeden Versand eine eindeutige cbc:ID verwenden.
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
    xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
    <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:peppol:france:billing:cius:1.0</cbc:CustomizationID>
    <cbc:ProfileID>S1</cbc:ProfileID>
    <cbc:ID>FA-2026-0001</cbc:ID>
    <cbc:IssueDate>2026-07-28</cbc:IssueDate>
    <cbc:DueDate>2026-08-28</cbc:DueDate>
    <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
    <cbc:Note>FA-2026-0001 - Test Company A, SIREN 256685928</cbc:Note>
    <cbc:Note>#PMT#Credit transfer</cbc:Note>
    <cbc:Note>#PMD#FA-2026-0001</cbc:Note>
    <cbc:Note>#AAB#Paiement a 30 jours par virement bancaire.</cbc:Note>
    <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
    <cbc:BuyerReference>TEST-BUYER-B</cbc:BuyerReference>
    <cac:AccountingSupplierParty>
        <cac:Party>
            <cbc:EndpointID schemeID="0225">256685928</cbc:EndpointID>
            <cac:PartyName>
                <cbc:Name>Test Company A</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
                <cbc:StreetName>1 Rue de Test</cbc:StreetName>
                <cbc:CityName>Paris</cbc:CityName>
                <cbc:PostalZone>75001</cbc:PostalZone>
                <cbc:CountrySubentity>Ile-de-France</cbc:CountrySubentity>
                <cac:Country>
                    <cbc:IdentificationCode>FR</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
                <cbc:CompanyID>FR16256685928</cbc:CompanyID>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity>
                <cbc:RegistrationName>Test Company A</cbc:RegistrationName>
                <cbc:CompanyID schemeID="0002">256685928</cbc:CompanyID>
            </cac:PartyLegalEntity>
            <cac:Contact>
                <cbc:ElectronicMail>company-a@example.test</cbc:ElectronicMail>
            </cac:Contact>
        </cac:Party>
    </cac:AccountingSupplierParty>
    <cac:AccountingCustomerParty>
        <cac:Party>
            <cbc:EndpointID schemeID="0225">346628948</cbc:EndpointID>
            <cac:PartyName>
                <cbc:Name>Test Company B</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
                <cbc:StreetName>2 Rue de Test</cbc:StreetName>
                <cbc:CityName>Lyon</cbc:CityName>
                <cbc:PostalZone>69001</cbc:PostalZone>
                <cbc:CountrySubentity>Auvergne-Rhone-Alpes</cbc:CountrySubentity>
                <cac:Country>
                    <cbc:IdentificationCode>FR</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
                <cbc:CompanyID>FR05346628948</cbc:CompanyID>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity>
                <cbc:RegistrationName>Test Company B</cbc:RegistrationName>
                <cbc:CompanyID schemeID="0002">346628948</cbc:CompanyID>
            </cac:PartyLegalEntity>
            <cac:Contact>
                <cbc:ElectronicMail>account-b@example.test</cbc:ElectronicMail>
            </cac:Contact>
        </cac:Party>
    </cac:AccountingCustomerParty>
    <cac:Delivery>
        <cbc:ActualDeliveryDate>2026-07-29</cbc:ActualDeliveryDate>
    </cac:Delivery>
    <cac:PaymentMeans>
        <cbc:PaymentMeansCode name="Credit transfer">30</cbc:PaymentMeansCode>
        <cbc:PaymentID>FA-2026-0001</cbc:PaymentID>
        <cac:PayeeFinancialAccount>
            <cbc:ID>FR7630006000011234567890189</cbc:ID>
            <cbc:Name>Test Company A</cbc:Name>
            <cac:FinancialInstitutionBranch>
                <cbc:ID>AGRIFRPP</cbc:ID>
            </cac:FinancialInstitutionBranch>
        </cac:PayeeFinancialAccount>
    </cac:PaymentMeans>
    <cac:PaymentTerms>
        <cbc:Note>Paiement a 30 jours par virement bancaire.</cbc:Note>
    </cac:PaymentTerms>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="EUR">260.00</cbc:TaxAmount>
        <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="EUR">1300.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="EUR">260.00</cbc:TaxAmount>
            <cac:TaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>20.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:TaxCategory>
        </cac:TaxSubtotal>
    </cac:TaxTotal>
    <cac:LegalMonetaryTotal>
        <cbc:LineExtensionAmount currencyID="EUR">1300.00</cbc:LineExtensionAmount>
        <cbc:TaxExclusiveAmount currencyID="EUR">1300.00</cbc:TaxExclusiveAmount>
        <cbc:TaxInclusiveAmount currencyID="EUR">1560.00</cbc:TaxInclusiveAmount>
        <cbc:PayableAmount currencyID="EUR">1560.00</cbc:PayableAmount>
    </cac:LegalMonetaryTotal>
    <cac:InvoiceLine>
        <cbc:ID>1</cbc:ID>
        <cbc:InvoicedQuantity unitCode="DAY">7.0</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="EUR">700.00</cbc:LineExtensionAmount>
        <cac:Item>
            <cbc:Description>Architecture review services</cbc:Description>
            <cbc:Name>Architecture review</cbc:Name>
            <cac:ClassifiedTaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>20.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:ClassifiedTaxCategory>
        </cac:Item>
        <cac:Price>
            <cbc:PriceAmount currencyID="EUR">100.0</cbc:PriceAmount>
        </cac:Price>
    </cac:InvoiceLine>
    <cac:InvoiceLine>
        <cbc:ID>2</cbc:ID>
        <cbc:InvoicedQuantity unitCode="DAY">3.0</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="EUR">600.00</cbc:LineExtensionAmount>
        <cac:Item>
            <cbc:Description>API integration services</cbc:Description>
            <cbc:Name>API integration</cbc:Name>
            <cac:ClassifiedTaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>20.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:ClassifiedTaxCategory>
        </cac:Item>
        <cac:Price>
            <cbc:PriceAmount currencyID="EUR">200.0</cbc:PriceAmount>
        </cac:Price>
    </cac:InvoiceLine>
</Invoice>

Erkanntes / erwartetes Format: france_cius.invoice.1_0.xml_ubl.en16931.

Schritt A — Upload

CIUS-XML oder JSON-Modell hochladen (siehe Formate oben).

Schritt B — Senden

1
2
3
POST /api/v2/documents/{document_id}/send
Content-Type: application/json
x-api-key: <your-api-key>
{ "transaction_type": "send.france" }

transaction.id speichern.

Schritt C — Transaktion pollen

Empfohlener Poll:

GET /api/v2/transactions/{transaction_id}?include=events&include=status_log

Weitere nützliche Calls:

Call Zweck
GET /api/v2/transactions/{id}/events Transaction-Event-Liste (+ verschachtelte Transaction Event Files)
GET /api/v2/transaction-events/{event_id} Einzelnes Transaction Event (+ Files)
GET /api/v2/transaction-event-files/{file_id}/download Transaction Event File herunterladen
GET /api/v2/transactions?document_id={document_id} Alle Transactions für ein Dokument

Polling-Empfehlung:

  • Intervall: 5–30 Sekunden, solange Transaction-status processing ist
  • Stoppen, wenn die Transaction completed oder failed erreicht
  • Zuletzt gesehene Transaction-Event-IDs speichern, nur neue Events verarbeiten
  • Bei Bedarf Payloads über Transaction Event Files (files[].id) herunterladen

Typische Outbound-Transaction-Events

Transaction Event type Bedeutung
france.invoice.prepare Für den Provider aufbereitet
france.invoice.send An den France-Kanal übermittelt
france.invoice.approved Käufer genehmigt
france.invoice.refused Käufer abgelehnt
france.invoice.payment_received Zahlungseingang bestätigt (CDV 212, B2B Inland)
france.tax_report.send / acknowledged / registered Zugehörige Tax-Report-Verarbeitung

Der genaue Zeitpunkt hängt vom Szenario (Inland vs. grenzüberschreitend) und der Provider-Verarbeitung ab. Manche Tax-Report-Events erscheinen später.

Schritt D — Optionale Zahlung

POST /api/v2/payments

Zuordnung auf die Dokument-ID (nicht die Transaktions-ID). Für ausgehende Rechnungen erstellt POST /api/v2/transactions/{transaction_id}/actions mit { "type": "france.invoice.payment_received" } dieselbe Art Zahlung für das Dokument der Transaktion; das passende Event france.invoice.payment_received erscheint üblicherweise nach der Kanal-Notification (bei B2B Inland CDV 212). Für eingehende Rechnungen verwenden Sie france.invoice.payment_sent, um die Zahlung als übermittelt zu markieren, ohne ein Payment zu erstellen (bei B2B Inland CDV 211).


Inbound-Integrationsmuster

Eingehende Dokumente legt xTool an, wenn der Kanal sie liefert. Ihre Aufgabe: finden, speichern, reagieren.

Discovery

1
2
3
GET /api/v2/documents?direction=inbound
GET /api/v2/transactions?transaction_type=receive.france
GET /api/v2/transactions?document_id={document_id}

Muster:

  1. Inbound-Dokumente und/oder receive.france-Transaktionen zeitgesteuert pollen
  2. Nach Dokument-ID deduplizieren
  3. Inhalt einmal abrufen, dann ERP-Buchung steuern

Inhalt lesen

1
2
3
GET /api/v2/documents/{document_id}?include=model&include=status_log
GET /api/v2/documents/{document_id}/xml
GET /api/v2/documents/{document_id}/model

Optional:

POST /api/v2/documents/{document_id}/ack
{ "ack": true }

Empfangs-Transaktion prüfen

GET /api/v2/transactions/{transaction_id}?include=events&include=actions&include=status_log

Transaction Event france.invoice.receive trägt typischerweise die eingehende Rechnung als Transaction Event Files. Download über /api/v2/transaction-event-files/{id}/download.

Käuferantwort (Transaction Actions)

Nur bei receive.france:

POST /api/v2/transactions/{transaction_id}/actions
{ "type": "france.invoice.approve" }
1
2
3
4
5
{
  "type": "france.invoice.refuse",
  "reason": "Incorrect amount",
  "reason_code": null
}

Weitere Käufer-Lifecycle-Actions: france.invoice.acknowledge, france.invoice.partially_approve, france.invoice.dispute.

Anschließend Transaction Events pollen, bis das passende Lifecycle-Event erscheint (z. B. france.invoice.approved oder france.invoice.refused) — auf Empfänger- und Senderseite, sobald das Netzwerk propagiert. Prüfen Sie auch den Transaction-Action-status (processingcompleted / failed).


Payments-API (France-relevante Regeln)

Methode Pfad
POST /api/v2/payments
GET /api/v2/payments
GET /api/v2/payments/{payment_id}
PATCH /api/v2/payments/{payment_id}
DELETE /api/v2/payments/{payment_id}/delete

Faustregeln:

  • currency ist beim Anlegen Pflicht (für typische France-Inland-Flows EUR)
  • Zuordnungen zielen auf document_id + amount
  • PATCH des Betrags schreibt Zuordnungen nicht um, außer Sie senden auch allocations
  • Teilzahlungen sind üblich: mehrere Zahlungen über die Zeit für eine Rechnung

Tax-Reports-API

Nur lesend:

GET /api/v2/tax-reports
GET /api/v2/tax-reports/{tax_report_id}

Berichte listen Quellen (document, payment, …). Tax Reports legen Sie nicht per API an; sie entstehen aus der France-Verarbeitung (bei aggregierten / grenzüberschreitenden Szenarien ggf. verzögert).


Endpunkt-Übersicht

Documents

Methode Pfad Hinweise
POST /api/v2/documents/upload/xml Outbound/Inbound über Query direction
POST /api/v2/documents/upload/model JSON-Modell-Upload
GET /api/v2/documents Filter direction=inbound / outbound
GET /api/v2/documents/{id} Optional include=model, status_log
GET /api/v2/documents/{id}/xml XML-Darstellung
GET /api/v2/documents/{id}/model Modell-Darstellung
POST /api/v2/documents/{id}/send Body: transaction_type
POST /api/v2/documents/{id}/ack Optionaler Inbound-Ack

Transactions / Transaction Events / Transaction Actions / Transaction Event Files

Methode Pfad Hinweise
GET /api/v2/transactions Filter: document_id, transaction_type, transaction_status
GET /api/v2/transactions/{id} include=events, actions, status_log
GET /api/v2/transactions/{id}/events Transaction Events (inkl. verschachtelter Transaction Event Files)
GET /api/v2/transaction-events/{id} Einzelnes Transaction Event + Files
GET /api/v2/transaction-event-files/{id}/download Inhalt eines Transaction Event Files herunterladen
GET /api/v2/transactions/{id}/actions Transaction Actions auflisten
POST /api/v2/transactions/{id}/actions Transaction Action anlegen (Käufer-Lifecycle / paid)

Es gibt keinen Get-by-ID für eine einzelne Transaction Action.

Payments / Tax reports

Siehe Tabellen oben.


Fehlerbehandlung

Situation Vorgehen
400 bei Upload / Send Validierung / Format / France-Regeln prüfen (Währung, Profile, Käufer-ID, …)
400 „No active France configuration“ Onboarding unter Channels → France in der Web-UI abschließen
400 annuaire_only cannot issue Tax-Report-Modus für Versand auf full umstellen
Transaction failed Transaction Events + status_log lesen; Daten korrigieren und erneut senden (neue Transaction)
Inbound fehlt Empfänger-Konfiguration Active? direction=inbound und receive.france pollen
Payment angelegt, aber noch kein paid-Event Auf Kanalbestätigung warten; Transaction Events weiter pollen

Für Support immer transaction_id, document_id, Transaction-Event-types und Transaction-Action-IDs protokollieren.


Empfohlene Implementierungs-Checkliste

  1. Web-Setup — Active France-Konfiguration(en); SIREN/SIRET als Verkäufer/Käufer notieren
  2. Auth — API-Schlüssel mit France-Send- (+ Lese-)Rechten
  3. Outbound-Worker — Upload → send.france → Transaction / Transaction Events / Event Files pollen → optional Payment
  4. Inbound-Worker — Inbound / receive.france pollen → Document-XML/Modell und/oder Transaction Event Files → ERP → Transaction Actions (approve / refuse / …) → optional Payment
  5. Reporting — periodisch GET /api/v2/tax-reports und Quellen mit Dokumenten/Zahlungen abgleichen
  6. Idempotenz — externe Rechnungsnummer ↔ xTool-Dokument-ID speichern; doppelte Inbound-IDs ignorieren
  7. Observability — Transaction-Event-Timeline (und Action-Ergebnisse) pro Dokument für Audits persistieren

Copy-Paste-HTTP-Beispiele zu jedem Schritt: Rechnungen senden und empfangen.