oneapi
Sign in
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

etransport.xml application/xml · 1,1 KB — sent as is, in the request body.

An intra-community supply

etransport-lic.xml application/xml · 1,0 KB — sent as is, in the request body.

An export

etransport-exp.xml application/xml · 1,0 KB — sent as is, in the request body.

Query parameters

This route accepts no query parameters.

How it behaves

  • The document can also be sent as a file: multipart/form-data with the fisier field (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 to fisier returns 422 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"
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
422xml_invalidXML that cannot be parsed or is not a recognisable e-Transport declaration.
429cota_depasitaThe 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"
    }
}