Read invoice
From a CIUS-RO invoice it extracts the business data as JSON, with the same keys you would send to build. For reading received invoices without touching the XML.
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 CIUS-RO invoice XML and returns the matching business JSON — seller, buyer, lines, rates, totals. It is the inverse of
/anaf/v1/efactura/build: together they make the JSON ⇄ XML round-trip. - The typical use is reading a received invoice: instead of parsing the UBL by hand, you ask here for the business structure already extracted and work with it. The JSON returned has the same shape
buildaccepts, so you can regenerate, edit or compare it. - The round-trip now also covers the blocks that used to be dropped: the payee (BG-10), the tax representative (BG-11), the attached documents (BG-24, base64 content included), the prepaid amount and the payment rounding.
- The exception is the exchange rate: UBL does not carry it explicitly, so we derive it from the
cac:TaxTotalpair (VAT in the invoice currency and the same VAT in RON). It comes out exact to 4 decimals only when VAT is non-zero; on a zero-VAT invoice (intra-community supply, export) there is nothing to derive it from, so it is absent — andbuildwill ask for it back, explicitly. - Zero retention: the XML received is not written and not logged; parsing is stateless and in-memory.
- An XML that cannot be parsed (not well-formed, or not a recognizable CIUS-RO invoice) returns
422in the common{eroare:{cod,mesaj,camp}}shape.
What it is for
- Reading an invoice received from a supplier, without writing a UBL parser.
- Round-trip: parse an invoice, edit a field, regenerate it with
build. - Extracting totals and lines for import into an accounting system.
Response structure
build accepts (seller, buyer, lines, rates, totals).
Response examples
body: @efactura.xml
{
"data": {
"type": "invoice",
"number": "FCT-2026-0142",
"issue_date": "2026-09-10",
"due_date": "2026-10-10",
"currency": "RON",
"supplier": {
"name": "Exemplu Furnizor SRL",
"vat_id": "RO990000005",
"address": {
"street": "Str. Memorandumului 28",
"city": "Cluj-Napoca",
"county": "RO-CJ",
"country": "RO"
}
},
"customer": {
"name": "Exemplu Client SRL",
"vat_id": "RO990000072",
"address": {
"street": "Calea Victoriei 1",
"city": "SECTOR1",
"county": "RO-B",
"country": "RO"
}
},
"lines": [
{
"id": "1",
"name": "Servicii de consultanţă",
"quantity": 2,
"unit": "H87",
"unit_price": 100,
"vat": {
"rate": 21,
"category": "S"
}
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 42+03: 00"
}
}
body: @efactura-corectata.xml
{
"data": {
"type": "invoice",
"number": "FCT-2026-0142",
"issue_date": "2026-09-10",
"due_date": "2026-10-10",
"currency": "RON",
"supplier": {
"name": "Exemplu Furnizor SRL",
"vat_id": "RO990000005",
"address": {
"street": "Str. Memorandumului 28",
"city": "Cluj-Napoca",
"county": "RO-CJ",
"country": "RO"
}
},
"customer": {
"name": "Exemplu Client SRL",
"vat_id": "RO990000072",
"address": {
"street": "Calea Victoriei 1",
"city": "SECTOR1",
"county": "RO-B",
"country": "RO"
}
},
"lines": [
{
"id": "1",
"name": "Servicii de consultanţă",
"quantity": 3,
"unit": "H87",
"unit_price": 100,
"vat": {
"rate": 21,
"category": "S"
}
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 42+03: 00"
}
}
body: @efactura-stornare.xml
{
"data": {
"type": "credit_note",
"number": "STN-2026-0007",
"issue_date": "2026-09-20",
"currency": "RON",
"preceding_invoices": [
{
"number": "FCT-2026-0142",
"issue_date": "2026-09-10"
}
],
"supplier": {
"name": "Exemplu Furnizor SRL",
"vat_id": "RO990000005",
"address": {
"street": "Str. Memorandumului 28",
"city": "Cluj-Napoca",
"county": "RO-CJ",
"country": "RO"
}
},
"customer": {
"name": "Exemplu Client SRL",
"vat_id": "RO990000072",
"address": {
"street": "Calea Victoriei 1",
"city": "SECTOR1",
"county": "RO-B",
"country": "RO"
}
},
"lines": [
{
"id": "1",
"name": "Stornare servicii de consultanta",
"quantity": 1,
"unit": "H87",
"unit_price": 200,
"vat": {
"rate": 21,
"category": "S"
}
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 42+03: 00"
}
}
body: @efactura-intracomunitara.xml
{
"data": {
"type": "invoice",
"number": "FCT-2026-0150",
"issue_date": "2026-09-25",
"due_date": "2026-10-25",
"currency": "EUR",
"supplier": {
"name": "Exemplu Furnizor SRL",
"vat_id": "RO990000005",
"address": {
"street": "Str. Memorandumului 28",
"city": "Cluj-Napoca",
"county": "RO-CJ",
"country": "RO"
}
},
"customer": {
"name": "Exemplu Client GmbH",
"vat_id": "DE999000009",
"address": {
"street": "Leopoldstrasse 1",
"city": "Muenchen",
"county": "DE-BY",
"country": "DE"
}
},
"delivery": {
"date": "2026-09-24",
"address": {
"street": "Leopoldstrasse 1",
"city": "Muenchen",
"county": "DE-BY",
"country": "DE"
}
},
"lines": [
{
"id": "1",
"name": "Licenta software anuala",
"quantity": 1,
"unit": "H87",
"unit_price": 1200,
"vat": {
"rate": 0,
"category": "K"
}
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 42+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 | The body is not parsable XML or is not a recognizable CIUS-RO invoice. |
| 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": "The body is not parsable XML or is not a recognizable CIUS-RO invoice.",
"camp": null,
"request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
}
}