submit_flow
Submit electronic invoices, e-reporting, or lifecycle statuses to the Approved Platform with a two-step confirmation process for user approval.
Instructions
Submit an electronic invoice, e-reporting, or lifecycle status to the Approved Platform.
This is the primary action for sending B2B invoices (Factur-X, UBL, CII), B2BInt/B2C e-reportings, or CDAR lifecycle status messages.
HUMAN-IN-THE-LOOP: This tool requires explicit user confirmation. Call without confirmation_token first; show the returned summary to the user; then call again with the provided token to execute the submission.
BEHAVIOR:
Submission is asynchronous: the AP returns a flowId and an initial status (typically 'Deposited'), not the final delivery status. Poll get_flow(flow_id) or search_flows to track processing.
Returns an error dict (with 'error' key) if the base64 encoding is invalid.
The AP may reject the flow synchronously (e.g. malformed XML, unknown recipient, quota exceeded); in that case the response contains an error code and message.
If processing_rule is B2B, the recipient must be registered in the PPF directory with an active directory line; verify with get_directory_line before submitting.
RESPONSE on success: includes flowId (AP-assigned identifier), trackingId (echoed back), status (initial processing status), and submittedAt timestamp.
USAGE GUIDELINES:
Always call get_directory_line (or search_directory_line) first to confirm the recipient is reachable and to identify their Approved Platform before submitting a B2B invoice.
Set a meaningful tracking_id (invoice number or UUID) to simplify later retrieval via search_flows.
After submission, use get_flow(flow_id, doc_type='Metadata') to monitor the flow status.
For lifecycle statuses on received invoices (Refused, Approved, etc.), prefer submit_lifecycle_status which provides structured status fields and handles mandatory PPF transmissions.
Call healthcheck_flow before a batch submission to confirm the AP is available.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_base64 | Yes | File content encoded in base64. Accepted formats: Factur-X (PDF/A-3 with embedded XML), UBL 2.1 (XML), UN/CEFACT CII D22B (XML). Maximum file size is defined by the Approved Platform (typically a few MB). | |
| file_name | Yes | File name with extension (e.g. 'invoice_2024_001.xml', 'invoice_2024_001.pdf'). The AP uses the extension to detect the format when flow_syntax is ambiguous. | |
| flow_syntax | Yes | Syntax/format of the submitted file (required). Common values: FacturX — PDF/A-3 with embedded Factur-X XML; UBL — UBL 2.1 XML invoice or credit note; CII — UN/CEFACT CII D22B XML invoice; CDAR — XML lifecycle status document; EReporting — B2B or B2C e-reporting flow. | |
| processing_rule | Yes | Processing rule that determines routing and PPF transmission obligations. B2B: domestic invoice between French VAT-registered entities (routed + reported to PPF). B2BInt: international invoice or cross-border e-reporting. B2C: invoice to a non-taxable entity or B2C e-reporting. B2G: invoice to a public-sector entity (v1.2.0). B2GInt: international invoice to a public-sector entity (v1.2.0). B2GOutOfScope: public-sector transaction outside reform scope (v1.2.0). OutOfScope: transaction outside the reform scope (archived only). ArchiveOnly: archiving without routing to recipient. NotApplicable: used for lifecycle status (CDAR) flows. | |
| flow_type | Yes | Business type of the submitted flow. Common values: Invoice, CreditNote, DebitNote, EReportingB2B, EReportingB2C, LifecycleStatus. Refer to your Approved Platform's documentation for the exhaustive list. | |
| tracking_id | No | Sender-assigned tracking identifier (free-form, maxLength 36). Recommended: use the invoice number or an internal UUID. Allows retrieving this specific flow later via search_flows(tracking_id=...). | |
| confirmation_token | No | Confirmation token returned by a previous call to this tool. Required to actually submit; omit on the first call to receive a summary and token for user approval. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||