Anaf v1 / e-Transport
Read declaration
From an e-Transport notification it extracts the data as JSON: the goods, the partner, the carrier, the start and end locations, the accompanying documents.
POST
https://oneapi.ro/api/anaf/v1/etransport/parse
Request body
The request body is the whole document, sent raw (Content-Type: application/xml) — not an object with fields.
A transport declaration
An intra-community supply
An export
Query parameters
This route accepts no 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 the XML of an e-Transport v2 declaration and returns the corresponding business JSON — the inverse of
build. Together they round-trip JSON ⇄ XML. - Zero retention: parsing is stateless, in-memory.
What it is for
- Reading a declaration you received, without writing an XML parser.
- Round-trip: parse, change one field, re-generate with
build.
Response structure
FieldTypeDescription
data.declarant
string
data.ref_declarant
string
data.operatiune
string
data.bunuri[].scop
string
data.bunuri[].cod_tarifar
string
data.bunuri[].denumire
string
The name, exactly as the source publishes it.
data.bunuri[].cantitate
integer
data.bunuri[].unitate
string
Unit of measure of the values. Read it before plotting or summing them.
data.bunuri[].greutate_neta
integer
data.bunuri[].greutate_bruta
integer
data.bunuri[].valoare
integer
The value published by the source for the combination above.
data.partener.tara
string
The country the value refers to.
data.partener.cod
string
Code from the source code list — the key you filter on.
data.partener.denumire
string
The name, exactly as the source publishes it.
data.transport.nr_vehicul
string
data.transport.tara_organizator
string
data.transport.cod_organizator
string
data.transport.denumire_organizator
string
data.transport.data
string
The business JSON — the same shape that
build accepts.
data.loc_start.locatie.judet
string
The county the value refers to.
data.loc_start.locatie.localitate
string
data.loc_start.locatie.strada
string
data.loc_start.locatie.numar
string
Number of items counted.
data.loc_start.locatie.cod_postal
string
data.loc_final.locatie.judet
string
The county the value refers to.
data.loc_final.locatie.localitate
string
data.loc_final.locatie.strada
string
data.loc_final.locatie.numar
string
Number of items counted.
data.loc_final.locatie.cod_postal
string
data.documente[].tip
string
data.documente[].numar
string
Number of items counted.
data.documente[].data
string
The business JSON — the same shape that
build accepts.
meta.generat_la
string
When the response was built (ISO 8601).
Response examples
body: @etransport.xml
POSThttps://oneapi.ro/api/anaf/v1/etransport/parse
{
"data": {
"declarant": "990000005",
"ref_declarant": "AVZ-2026-0142",
"operatiune": "30",
"bunuri": [
{
"scop": "101",
"cod_tarifar": "84713000",
"denumire": "Laptop 14 inch",
"cantitate": 20,
"unitate": "H87",
"greutate_neta": 30,
"greutate_bruta": 38,
"valoare": 64000
}
],
"partener": {
"tara": "RO",
"cod": "990000072",
"denumire": "Exemplu Client SRL"
},
"transport": {
"nr_vehicul": "CJ10ABC",
"tara_organizator": "RO",
"cod_organizator": "990000005",
"denumire_organizator": "Exemplu Furnizor SRL",
"data": "2026-09-10"
},
"loc_start": {
"locatie": {
"judet": "12",
"localitate": "Cluj-Napoca",
"strada": "Str. Memorandumului",
"numar": "28",
"cod_postal": "400114"
}
},
"loc_final": {
"locatie": {
"judet": "40",
"localitate": "Sector 1",
"strada": "Calea Victoriei",
"numar": "1",
"cod_postal": "010071"
}
},
"documente": [
{
"tip": "30",
"numar": "AVZ-2026-0142",
"data": "2026-09-10"
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 43+03: 00"
}
}
body: @etransport-lic.xml
POSThttps://oneapi.ro/api/anaf/v1/etransport/parse
{
"data": {
"declarant": "990000005",
"ref_declarant": "LIC-2026-0007",
"operatiune": "20",
"bunuri": [
{
"scop": "101",
"cod_tarifar": "84713000",
"denumire": "Laptop 14 inch",
"cantitate": 50,
"unitate": "H87",
"greutate_neta": 75,
"greutate_bruta": 95,
"valoare": 160000
}
],
"partener": {
"tara": "DE",
"cod": "DE999000009",
"denumire": "Exemplu Client GmbH"
},
"transport": {
"nr_vehicul": "CJ10ABC",
"tara_organizator": "RO",
"cod_organizator": "990000005",
"denumire_organizator": "Exemplu Furnizor SRL",
"data": "2026-09-18"
},
"loc_start": {
"locatie": {
"judet": "12",
"localitate": "Cluj-Napoca",
"strada": "Str. Memorandumului",
"numar": "28",
"cod_postal": "400114"
}
},
"loc_final": {
"ptf": "1"
},
"documente": [
{
"tip": "30",
"numar": "LIC-2026-0007",
"data": "2026-09-18"
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 43+03: 00"
}
}
body: @etransport-exp.xml
POSThttps://oneapi.ro/api/anaf/v1/etransport/parse
{
"data": {
"declarant": "990000005",
"ref_declarant": "EXP-2026-0011",
"operatiune": "50",
"bunuri": [
{
"scop": "9999",
"cod_tarifar": "94036010",
"denumire": "Mobilier din lemn",
"cantitate": 120,
"unitate": "H87",
"greutate_neta": 2400,
"greutate_bruta": 2650,
"valoare": 96000
}
],
"partener": {
"tara": "RS",
"cod": "RS100001111",
"denumire": "Exemplu Partener DOO"
},
"transport": {
"nr_vehicul": "TM20XYZ",
"tara_organizator": "RO",
"cod_organizator": "990000005",
"denumire_organizator": "Exemplu Furnizor SRL",
"data": "2026-09-22"
},
"loc_start": {
"locatie": {
"judet": "35",
"localitate": "Timisoara",
"strada": "Calea Aradului",
"numar": "10",
"cod_postal": "300636"
}
},
"loc_final": {
"birou_vamal": "22801"
},
"documente": [
{
"tip": "30",
"numar": "EXP-2026-0011",
"data": "2026-09-22"
}
]
},
"meta": {
"generat_la": "2026-10-06T23: 59: 43+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 recognisable e-Transport declaration. |
| 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 recognisable e-Transport declaration.",
"camp": null,
"request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
}
}