Read D406
From a D406 it extracts the header and a summary: the declared period, the company, the record count for each section. The whole file is not returned — it holds tens of thousands of rows.
Request body
The request body is the whole document, sent raw (Content-Type: application/xml) — not an object with fields.
Query parameters
How it behaves
- The document can also be sent as a file:
multipart/form-datawith thefisierfield (curl -F fisier=@document.xml), instead of the raw body. The file content becomes the request body, so the result is identical; options stay in the query string, and any other form field next tofisierreturns422 camp_necunoscut. - Takes a D406 and returns a business JSON: the full header (company, period, currency, software) plus a per-section summary — counts (accounts, customers, suppliers, products, journals, invoices, payments…) and totals (debit/credit).
- Because a real file is large, we return a structured summary, not an element-by-element transcription (which would be enormous). Enough to understand the shape and the key figures of the file.
- Zero retention: parsing is stateless, in-memory.
What it is for
- A quick inspection of a received/generated D406: what period it covers, how many documents, what totals.
Response structure
RO prefix.
Response examples
body: @saft-d406.xml
{
"data": {
"header": {
"versiune": "2.4.9",
"tara": "RO",
"data_creare": "2026-10-05",
"software": {
"nume": "Exemplu Software SRL",
"id": "Exemplu ERP",
"versiune": "1.0"
},
"firma": {
"cui": "990000005",
"nume": "Exemplu Furnizor SRL",
"adresa": {
"strada": "Str. Memorandumului 28",
"oras": "Cluj-Napoca",
"cod_postal": "400114",
"tara": "RO"
}
},
"moneda": "RON",
"perioada": {
"luna_start": "9",
"an_start": "2026",
"luna_end": "9",
"an_end": "2026"
},
"segment": "1"
},
"rezumat": {
"master_files": {
"conturi": 3,
"clienti": 1,
"cote_tva": 1,
"unitati_masura": 1
},
"jurnal": {
"nr_jurnale": 1,
"nr_tranzactii": 2,
"total_debit": 2057,
"total_credit": 2057
},
"documente": {
"facturi_vanzari": 2
}
}
},
"meta": {
"generat_la": "2026-10-06T23: 59: 44+03: 00"
}
}
body: @saft-d406-trimestrial.xml
{
"data": {
"header": {
"versiune": "2.4.9",
"tara": "RO",
"data_creare": "2026-10-05",
"software": {
"nume": "Exemplu Software SRL",
"id": "Exemplu ERP",
"versiune": "1.0"
},
"firma": {
"cui": "990000005",
"nume": "Exemplu Furnizor SRL",
"adresa": {
"strada": "Str. Memorandumului 28",
"oras": "Cluj-Napoca",
"cod_postal": "400114",
"tara": "RO"
}
},
"moneda": "RON",
"perioada": {
"luna_start": "7",
"an_start": "2026",
"luna_end": "9",
"an_end": "2026"
},
"segment": "1"
},
"rezumat": {
"master_files": {
"conturi": 3,
"clienti": 1,
"cote_tva": 1,
"unitati_masura": 1
},
"jurnal": {
"nr_jurnale": 1,
"nr_tranzactii": 2,
"total_debit": 2057,
"total_credit": 2057
},
"documente": {
"facturi_vanzari": 2
}
}
},
"meta": {
"generat_la": "2026-10-06T23: 59: 44+03: 00"
}
}
body: @saft-d406-anual.xml
{
"data": {
"header": {
"versiune": "2.4.9",
"tara": "RO",
"data_creare": "2026-10-05",
"software": {
"nume": "Exemplu Software SRL",
"id": "Exemplu ERP",
"versiune": "1.0"
},
"firma": {
"cui": "990000005",
"nume": "Exemplu Furnizor SRL",
"adresa": {
"strada": "Str. Memorandumului 28",
"oras": "Cluj-Napoca",
"cod_postal": "400114",
"tara": "RO"
}
},
"moneda": "RON",
"perioada": {
"luna_start": "1",
"an_start": "2026",
"luna_end": "12",
"an_end": "2026"
},
"segment": "1"
},
"rezumat": {
"master_files": {
"conturi": 3,
"clienti": 1,
"cote_tva": 1,
"unitati_masura": 1
},
"jurnal": {
"nr_jurnale": 1,
"nr_tranzactii": 2,
"total_debit": 2057,
"total_credit": 2057
},
"documente": {
"facturi_vanzari": 2
}
}
},
"meta": {
"generat_la": "2026-10-06T23: 59: 44+03: 00"
}
}
Error codes
| Code | Slug | When it occurs |
|---|---|---|
| 401 | neautentificat | Token missing, invalid, expired or revoked. |
| 403 | feature_indisponibil | The current plan does not include the feature the route depends on. |
| 422 | xml_invalid | XML that cannot be parsed or is not a SAF-T file (root <AuditFile>). |
| 429 | cota_depasita | The plan's monthly quota has been exceeded (see Retry-After). |
Errors in the Anaf module use the same envelope as the rest of the platform, with two extra fields: {eroare: {cod, mesaj, camp, request_id}}. eroare.cod is stable and is what you branch on; on validation (422) the code is case-specific: xml_invalid, xml_nu_e_factura, unitate_necunoscuta, luna_invalida and so on. camp points at the offending field when one can be identified.
{
"eroare": {
"cod": "xml_invalid",
"mesaj": "XML that cannot be parsed or is not a SAF-T file (root ``).",
"camp": null,
"request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
}
}