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": "ecritures_20260728_20260728.csv",
"content": "Date;Journal;Compte;LibelleCompte;Piece;Libelle;Debit;Credit\r\n2026-07-28;VE;531000;Encaissement espèces;T-1;T-1;36,00;0,00\r\n2026-07-28;VE;707000;Ventes de marchandises;T-1;T-1;0,00;30,00\r\n2026-07-28;VE;445710;TVA collectée;T-1;T-1;0,00;6,00",
"entries": [
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "531000",
"accountLabel": "Encaissement espèces",
"entryLabel": "T-1",
"documentRef": "T-1",
"debitCents": 3600,
"creditCents": 0
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "707000",
"accountLabel": "Ventes de marchandises",
"entryLabel": "T-1",
"documentRef": "T-1",
"debitCents": 0,
"creditCents": 3000
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "445710",
"accountLabel": "TVA collectée",
"entryLabel": "T-1",
"documentRef": "T-1",
"debitCents": 0,
"creditCents": 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 a generic accounting file (journal entries / configurable CSV)
Returns balanced double-entry journal entries (écritures comptables) for a date period over the per-ticket sales read model, serialised to a CONFIGURABLE, tool-agnostic ledger CSV importable into the common French accounting tools (Sage, Cegid, EBP, Quadra) WITHOUT a vendor-specific connector. Each ticket books a debit on the encaissement account of its settlement method (PCG 531/512/511/419…) and per-VAT-rate credits on revenue (707) + collected TVA (44571), so Σ débit = Σ crédit. The account mapping is FR-PCG-defaulted but OVERRIDABLE (revenueAccount, vatAccount, roundingAccount, cashAccount, bankAccount) and the CSV delimiter + decimalSeparator are configurable. 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); format=csv streams the raw ledger CSV as a text/csv attachment (ecritures_<from>_<to>.csv). 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": "ecritures_20260728_20260728.csv",
"content": "Date;Journal;Compte;LibelleCompte;Piece;Libelle;Debit;Credit\r\n2026-07-28;VE;531000;Encaissement espèces;T-1;T-1;36,00;0,00\r\n2026-07-28;VE;707000;Ventes de marchandises;T-1;T-1;0,00;30,00\r\n2026-07-28;VE;445710;TVA collectée;T-1;T-1;0,00;6,00",
"entries": [
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "531000",
"accountLabel": "Encaissement espèces",
"entryLabel": "T-1",
"documentRef": "T-1",
"debitCents": 3600,
"creditCents": 0
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "707000",
"accountLabel": "Ventes de marchandises",
"entryLabel": "T-1",
"documentRef": "T-1",
"debitCents": 0,
"creditCents": 3000
},
{
"journalCode": "VE",
"journalLabel": "Journal des ventes",
"entryNumber": "T-1",
"entryDate": "2026-07-28T10:00:00.000Z",
"accountNumber": "445710",
"accountLabel": "TVA collectée",
"entryLabel": "T-1",
"documentRef": "T-1",
"debitCents": 0,
"creditCents": 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 to one store by its canonical id.
json (default) returns the structured payload; csv streams the raw ledger CSV as a text/csv; charset=utf-8 attachment (ecritures_<from>_<to>.csv). Any other value 400s.
CSV field delimiter (default ;). One character.
Euro amount decimal separator, , (default) or ..
Override the revenue (707) account. 3–20 digits.
Override the collected-VAT (44571) account. 3–20 digits.
Override the rounding/suspense (471) account. 3–20 digits.
Override the cash encaissement (531) account. 3–20 digits.
Override the bank encaissement (512) account for card + split payments. 3–20 digits.
Response
For format=json (default): the structured export — balanced entries, totals and the CSV text. For format=csv: this JSON envelope is REPLACED by the raw ledger CSV streamed as a text/csv; charset=utf-8 attachment (Content-Disposition: attachment; filename="ecritures_<from>_<to>.csv") — the content field below is exactly that file body.
For format=json (default): the structured export — balanced entries, totals and the CSV text. For format=csv: this JSON envelope is REPLACED by the raw ledger CSV streamed as a text/csv; charset=utf-8 attachment (Content-Disposition: attachment; filename="ecritures_<from>_<to>.csv") — the content field below is exactly that file body.
-9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991Show child attributes
Show child attributes

