An e-invoice made available never taken in charge
Goal Know which e-invoice reached the buyer a week ago without being taken in charge, from the approved platform's lifecycle statuses.
Since 1 September 2026 every French company receives its invoices through an approved platform. Each invoice carries lifecycle statuses: Déposée, Mise à disposition, Prise en charge, Encaissée… An invoice that reached the buyer (203) and was never taken in charge (204) will not be paid on time.
- the status codes declared once, as a Workflow
- an unknown code reported at apply
- the invoice left in 203 for a week: a decision
invoice_no;buyer;amount;status_code;status_label;status_at INV-2026-301;Atelier Morel SAS;4 860,00;203;Mise à disposition;2026-11-09 09:30:00 INV-2026-302;Boulangerie Roux;245,90;203;Mise à disposition;2026-11-18 09:30:00 INV-2026-303;Garage Lefèvre;1 290,00;204;Prise en charge;2026-11-06 09:30:00 INV-2026-304;Imprimerie Saint-Éloi;2 310,75;212;Encaissée;2026-11-01 09:30:00 INV-2026-305;Pharmacie du Port;98,10;207;En litige;2026-11-12 09:30:00 INV-2026-306;Café de la Gare;62,30;299;Statut inconnu;2026-11-19 09:30:00
manifests/follow-up.kts
// Operator-provided: the day an invoice's last lifecycle status calls for a follow-up — seven days after it was set.// The Workflow's due date reads it in state 203 (made available) only: an invoice the buyer never took in charge.@Suppress("UNCHECKED_CAST")val cells = bindings["cells"] as MutableMap<String, Any?>val at = (cells["status_at"] as String?)?.trim()cells["follow_up_on"] = if (at.isNullOrEmpty()) null else java.time.LocalDate.parse(at.substring(0, 10)).plusDays(7).toString()manifests/10-lifecycle-export.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata: name: scenario-einvoice-a connector_type: csv-file scopes: [facturation-a]spec: transport: kind: sftp host: host.docker.internal port: 2231 user: pa path: /exports/cycle-de-vie.csv password_env: SCENARIO_EINVOICE_A_SFTP # The fingerprint the platform's export server presents, read out of band (ssh-keyscan | ssh-keygen -lf -). host_key_fingerprint: "SHA256:FINGERPRINT_READ_AT_REPLAY" parser: has_header: true delimiter: ";" encoding: UTF-8 after_process: none mapping: cell: - kotlin: script: hooks:follow-up-a.kts # the operator's script: seven days after the last status - parse-date: { column: status_at, formats: ["yyyy-MM-dd HH:mm:ss"], zone: Europe/Paris } - parse-date: { column: follow_up_on, formats: ["yyyy-MM-dd"] } - parse-number: { column: amount, decimal-separator: "," }manifests/20-einvoice-lifecycle.yaml
# The e-invoice lifecycle, XP Z12-012's status codes as the FNFE-MPE annex to XP Z12-014 (V1.2) names them.apiVersion: apps.lumnik.io/v1kind: Workflowmetadata: name: scenario-einvoice-lifecycle-aspec: scope: facturation-a provenance: declared on: table: connector.t_scenario_einvoice_a column: status_code key: invoice_no due: column: follow_up_on # seven days after the last status states: ["203"] # made available to the buyer, never taken in charge zone: Europe/Paris message: "{doc_key} for {buyer}, {amount} €: made available on {status_at}, never taken in charge — follow it up" states: - { code: "200", label: "Déposée", initial: true } - { code: "201", label: "Émise" } - { code: "202", label: "Reçue" } - { code: "203", label: "Mise à disposition" } - { code: "204", label: "Prise en charge" } - { code: "205", label: "Approuvée" } - { code: "206", label: "Approuvée partiellement" } - { code: "207", label: "En litige" } - { code: "208", label: "Suspendue" } - { code: "209", label: "Complétée" } - { code: "210", label: "Refusée", terminal: true } - { code: "211", label: "Paiement transmis" } - { code: "212", label: "Encaissée", terminal: true } - { code: "213", label: "Rejetée", terminal: true } - { code: "214", label: "Visée" } - { code: "220", label: "Annulée", terminal: true } - { code: "221", label: "Erreur de routage" } - { code: "224", label: "Demande de paiement direct" } - { code: "225", label: "Affacturée" } - { code: "226", label: "Affacturée confidentiel" } - { code: "227", label: "Changement de compte à payer" } - { code: "228", label: "Non affacturée" } - { code: "501", label: "Irrecevable", terminal: true }$ lm hook scripts
NAME SIZE SHA256
cfonb-amount-b.kts 784 3f94b73a8a923324f6750648e230e3d91026299ed636627a4562b14552d493ba
cfonb-amount-c.kts 784 3f94b73a8a923324f6750648e230e3d91026299ed636627a4562b14552d493ba
coordinates-c.kts 5076 cc87f4a8e8ccbb38f3306d4dce5a013dab984c36a8cd72afd72e8bd142504542
ean-check-b.kts 477 58c3d6b83a0df5c9ae779aada8604f6bd850db7c52ca258b5bc6dc45fd8ea23c
ean-check-c.kts 477 58c3d6b83a0df5c9ae779aada8604f6bd850db7c52ca258b5bc6dc45fd8ea23c
ean-check-d.kts 477 58c3d6b83a0df5c9ae779aada8604f6bd850db7c52ca258b5bc6dc45fd8ea23c
ean-draft-b.kts 476 c8692d84859f810de8903ded14a03a1ec4db93e1282aa88b4fb9f5e42b6586ea
ean-draft-c.kts 476 c8692d84859f810de8903ded14a03a1ec4db93e1282aa88b4fb9f5e42b6586ea
ean-draft-d.kts 526 90a58aae66c5feec5e52017e90d86b9ee93e46ce7d97dc0c1eb4b5faefb636a7
follow-up-a.kts 498 f5947f51c956b84be88e4ef1d2b10265c9bced0415d4f2bef50ed4393c72e0af
promised-date-b.kts 1407 44ceece5d17c40d337374d02f942aef41b092b6708ff7dbc48efc8b43aef1ac9
shipping-fee-c.kts 333 c1c59e5c7b81302d5a284c9c722ca8cacaca0fe859c8ae1c393cd1d54a1ad9ad
shipping-fee-p.kts 333 c1c59e5c7b81302d5a284c9c722ca8cacaca0fe859c8ae1c393cd1d54a1ad9ad
$ lm apply -f 10-lifecycle-export.yaml
Applied connector "scenario-einvoice-a" — 1 endpoint
$ lm connector run scenario-einvoice-a
run scheduled: 04d93713-c2a6-43d5-952a-36e7fd34b22b
$ lm run get 04d93713-c2a6-43d5-952a-36e7fd34b22b --wait-evaluated
ID CONNECTOR ENDPOINT STATUS IN OUT SKIPPED DEAD-LETTERS STARTED ENDED EVALUATED
04d93713 scenario-einvoice-a default Completed 6 6 0 0 2026-11-21 23:58 2026-11-21 23:58 yes
• script hooks:follow-up-a.kts sha256 f5947f51c956b84be88e4ef1d2b10265c9bced0415d4f2bef50ed4393c72e0af
$ lm workflow apply -f 20-einvoice-lifecycle.yaml -o json
{
"name": "scenario-einvoice-lifecycle-a",
"scope": "facturation-a",
"table": "connector.t_scenario_einvoice_a",
"column": "status_code",
"dataTruth": {
"undeclared": [
{
"value": "299",
"rows": 1
}
],
"unobserved": [
"200",
"201",
"202",
"205",
"206",
"208",
"209",
"210",
"211",
"213",
"214",
"220",
"221",
"224",
"225",
"226",
"227",
"228",
"501"
],
"nullOrBlank": 0,
"tableMissing": false,
"keyColumnMissing": false,
"keyNullOrBlank": 0,
"checkUnavailable": false,
"unavailableReason": null,
"dueProblem": null,
"invalidOrderValues": null,
"keysWithSeveralRows": null,
"columnsUnverified": []
}
}- run
- IN 6 · OUT 6 · cell errors 0
- undeclared at apply
- 299
- due date
- readable
evidence: replay.log, 00-check-lifecycle.txt, 01-hook-scripts.txt, 02-run.json, 03-workflow-apply.json, 04-decisions.json · transform v1
$ lm inbox --process workflow:scenario-einvoice-lifecycle-a
ID WHEN PROCESS MESSAGE ENTITY_KEY
31787 just now workflow:scenario-einvoice-lifecycle-a INV-2026-301 for Atelier Morel SAS, 4860 €: made available on 2026-11-09T08:30:00Z, never taken in charge — follow it up INV-2026-301- decision
- INV-2026-301 for Atelier Morel SAS, 4860 €: made available on 2026-11-09T08:30:00Z, never taken in charge — follow it up
- check_lifecycle.py
- INV-2026-301
evidence: replay.log, 00-check-lifecycle.txt, 01-hook-scripts.txt, 02-run.json, 03-workflow-apply.json, 04-decisions.json · transform v1
Limits
- The numbers 200 to 212 come from XP Z12-012, sold by AFNOR and not read here: they are taken from the list provided, which matches the annex wherever the annex gives a number.
- An export of last statuses, not the platform's XP Z12-013 API: the history of statuses is not read.
- The invoice itself (Factur-X, UBL, CII) is not read: lumnik reads XML on a REST answer only.
- Seven days is the supplier's choice, not a legal period.
- Six synthetic invoices, dated from the day of the replay.
This scenario needs lumnik Pro.
See the editions →