A valid request URL is required to generate request examples{
"from": "2026-07-28",
"to": "2026-07-28",
"entryCount": 3,
"totalDebitCents": 3600,
"totalCreditCents": 3600,
"balanced": true,
"fileName": "FEC_20260728_20260728.txt",
"content": "JournalCode\tJournalLib\tEcritureNum\tEcritureDate\tCompteNum\tCompteLib\tCompAuxNum\tCompAuxLib\tPieceRef\tPieceDate\tEcritureLib\tDebit\tCredit\tEcritureLet\tDateLet\tValidDate\tMontantdevise\tIdevise",
"entries": [
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-fec-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "411000",
"accountLabel": "Trade receivables",
"entryLabel": "T-fec-1",
"documentRef": "T-fec-1",
"debit": 3600,
"credit": 0
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-fec-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "707000",
"accountLabel": "Sales of goods",
"entryLabel": "T-fec-1",
"documentRef": "T-fec-1",
"debit": 0,
"credit": 3000
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-fec-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "445710",
"accountLabel": "Collected VAT",
"entryLabel": "T-fec-1",
"documentRef": "T-fec-1",
"debit": 0,
"credit": 600
}
]
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123,
"fieldErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}Export the FEC accounting file
Returns the French FEC (Fichier des Écritures Comptables — l’export comptable légal) for a date period over the per-ticket sales read model: balanced écritures comptables carrying the chiffre d’affaires and the collected TVA. REQUIRES from and to as YYYY-MM-DD with from <= to; a missing, malformed or inverted period returns 400. format defaults to json (the structured payload documented here: balanced entries + preview totals + the ready-to-download text); format=file instead streams the raw, legal tab-delimited FEC text as a text/plain attachment (FEC_<from>_<to>.txt). Optionally narrow to a single store.
A valid request URL is required to generate request examples{
"from": "2026-07-28",
"to": "2026-07-28",
"entryCount": 3,
"totalDebitCents": 3600,
"totalCreditCents": 3600,
"balanced": true,
"fileName": "FEC_20260728_20260728.txt",
"content": "JournalCode\tJournalLib\tEcritureNum\tEcritureDate\tCompteNum\tCompteLib\tCompAuxNum\tCompAuxLib\tPieceRef\tPieceDate\tEcritureLib\tDebit\tCredit\tEcritureLet\tDateLet\tValidDate\tMontantdevise\tIdevise",
"entries": [
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-fec-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "411000",
"accountLabel": "Trade receivables",
"entryLabel": "T-fec-1",
"documentRef": "T-fec-1",
"debit": 3600,
"credit": 0
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-fec-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "707000",
"accountLabel": "Sales of goods",
"entryLabel": "T-fec-1",
"documentRef": "T-fec-1",
"debit": 0,
"credit": 3000
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-fec-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "445710",
"accountLabel": "Collected VAT",
"entryLabel": "T-fec-1",
"documentRef": "T-fec-1",
"debit": 0,
"credit": 600
}
]
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123,
"fieldErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}Authorizations
Authorization: Bearer <token>. Accepts EITHER a Keycloak access token (scopes-in-token) OR an opaque POS session token; both resolve to the same pos.* scope vocabulary the route guards enforce.
Query Parameters
REQUIRED — inclusive period start (YYYY-MM-DD, from <= to). Missing/inverted → 400.
REQUIRED — inclusive period end (YYYY-MM-DD, from <= to). Missing/inverted → 400.
Optional — narrow the écritures comptables to one store by its canonical id.
Output representation: json (default) returns the structured payload documented on the 200 response; file instead streams the raw, legal tab-delimited FEC text as a text/plain; charset=utf-8 attachment (Content-Disposition: attachment; filename="FEC_<from>_<to>.txt") — the body is the file itself, not this JSON envelope. Any other value 400s.
Response
For format=json (default): the structured FEC export — balanced entries, preview totals and the FEC text. For format=file: this JSON envelope is REPLACED by the raw tab-delimited FEC file streamed as a text/plain; charset=utf-8 attachment (Content-Disposition: attachment; filename="FEC_<from>_<to>.txt") — the content field below is exactly that file body.
For format=json (default): the structured FEC export — balanced entries, preview totals and the FEC text. For format=file: this JSON envelope is REPLACED by the raw tab-delimited FEC file streamed as a text/plain; charset=utf-8 attachment (Content-Disposition: attachment; filename="FEC_<from>_<to>.txt") — the content field below is exactly that file body.
-9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991Show child attributes
Show child attributes

