oneapi
Sign in
Anaf v1 / e-Transport

Build declaration

You send the shipment as JSON and get the RO e-Transport XML (v2) back, run through the XSD and the Schematron rules. The operation, purpose, customs and border-point codes are checked against the official nomenclatures.

POST
https://oneapi.ro/api/anaf/v1/etransport/build

Request body

Sent as JSON in the request body (Content-Type: application/json) — not in the query string.

Domestic transport Request body
{
    "declarant": "990000005",
    "operatiune": "30",
    "ref_declarant": "AVZ-2026-0142",
    "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": {
        "tara_organizator": "RO",
        "cod_organizator": "990000005",
        "denumire_organizator": "Exemplu Furnizor SRL",
        "data": "2026-09-10",
        "nr_vehicul": "CJ10ABC"
    },
    "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"
        }
    ]
}
Intra-community supply, exit via a border point Request body
{
    "declarant": "990000005",
    "operatiune": "20",
    "ref_declarant": "LIC-2026-0007",
    "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": {
        "tara_organizator": "RO",
        "cod_organizator": "990000005",
        "denumire_organizator": "Exemplu Furnizor SRL",
        "data": "2026-09-18",
        "nr_vehicul": "CJ10ABC"
    },
    "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"
        }
    ]
}
Export to a non-EU country Request body
{
    "declarant": "990000005",
    "operatiune": "50",
    "ref_declarant": "EXP-2026-0011",
    "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": {
        "tara_organizator": "RO",
        "cod_organizator": "990000005",
        "denumire_organizator": "Exemplu Furnizor SRL",
        "data": "2026-09-22",
        "nr_vehicul": "TM20XYZ"
    },
    "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"
        }
    ]
}

Query parameters

NameTypeDescriptionAccepted values
validateoptional string Validation applied: local (default, official XSD + Schematron run locally) or none (generate only). e.g. locale.g. anafe.g. none
strictoptional boolean true (default) returns 422 with no XML if validation fails; false returns the XML anyway, with valid:false and the errors. e.g. false
formatoptional text Shape of the XML: xml (default) or base64. e.g. base64

How it behaves

  • Takes a business JSON — declarant, operation type, goods (with CN code, quantity, weight, value), partner, transport (vehicle, organiser), places of departure/arrival and documents — and returns the RO e-Transport declaration as v2 XML (mfp:anaf:dgti:eTransport:declaratie:v2), ready to file in SPV.
  • The operation type drives everything else. The allowed purposes, the mandatory fields and whether a route has an internal location or a border crossing point depend on codTipOperatiune (AIC, LIC, TTN, IMP, EXP, etc.). The engine checks consistency and warns where something does not add up.
  • validate selects the validation: local (the default) runs the official XSD plus the ANAF Schematron locally; none only generates the XML.
  • An unknown body field is rejected, not ignored. um instead of unitate, valoare_lei instead of valoare — you get 422 camp_necunoscut with the list accepted at that level, not a declaration silently missing the value.
  • No SPV submission. We deliver valid XML; the UIT code is obtained when the client files the declaration in SPV (a step that requires authentication — outside this stateless toolkit).
  • Zero retention. The payload is not written to disk, not logged, and never enters cache keys.

What it is for

  • Generating e-Transport XML from a WMS/ERP, before filing it in SPV.
  • Validating a declaration against the official XSD + Schematron, without sending it to ANAF yet.

Response structure

FieldTypeDescription
data.valid boolean The validation result; null when validate=none.
data.standard string The standard: ETRANSP-v2.
data.xml string The generated e-Transport XML; text or base64 depending on format.
data.meta object Metadata: namespace, cod_tip_operatiune, nr_bunuri, nr_documente.
data.meta.namespace string
data.meta.cod_tip_operatiune string
data.meta.nr_bunuri integer
data.meta.nr_documente integer
data.errors array Validation errors, when strict=false (with strict=true they come in the error envelope).
data.warnings array Non-blocking warnings {cod,mesaj,camp}.
meta.generat_la string When the response was built (ISO 8601).

Response examples

body: {"declarant": "990000005", "operatiune": "30", "ref_declarant": "AVZ-2026-0142", "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": {"tara_organizator": "RO", "cod_organizator": "990000005", "denumire_organizator": "Exemplu Furnizor SRL", "data": "2026-09-10", "nr_vehicul": "CJ10ABC"}, "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"}]}

POSThttps://oneapi.ro/api/anaf/v1/etransport/build
{
    "data": {
        "valid": true,
        "standard": "ETRANSP-v2",
        "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<eTransport xmlns=\"mfp:anaf:dgti:eTransport:declaratie:v2\" codDeclarant=\"990000005\" refDeclarant=\"AVZ-2026-0142\">\n  <notificare codTipOperatiune=\"30\">\n    <bunuriTransportate codScopOperatiune=\"101\" codTarifar=\"84713000\" denumireMarfa=\"Laptop 14 inch\" cantitate=\"20.00\" codUnitateMasura=\"H87\" greutateNeta=\"30.00\" greutateBruta=\"38.00\" valoareLeiFaraTva=\"64000.00\"/>\n    <partenerComercial codTara=\"RO\" cod=\"990000072\" denumire=\"Exemplu Client SRL\"/>\n    <dateTransport nrVehicul=\"CJ10ABC\" codTaraOrgTransport=\"RO\" codOrgTransport=\"990000005\" denumireOrgTransport=\"Exemplu Furnizor SRL\" dataTransport=\"2026-09-10\"/>\n    <locStartTraseuRutier>\n      <locatie codJudet=\"12\" denumireLocalitate=\"Cluj-Napoca\" denumireStrada=\"Str. Memorandumului\" numar=\"28\" codPostal=\"400114\"/>\n    </locStartTraseuRutier>\n    <locFinalTraseuRutier>\n      <locatie codJudet=\"40\" denumireLocalitate=\"Sector 1\" denumireStrada=\"Calea Victoriei\" numar=\"1\" codPostal=\"010071\"/>\n    </locFinalTraseuRutier>\n    <documenteTransport tipDocument=\"30\" numarDocument=\"AVZ-2026-0142\" dataDocument=\"2026-09-10\"/>\n  </notificare>\n</eTransport>\n",
        "meta": {
            "namespace": "mfp:anaf:dgti:eTransport:declaratie:v2",
            "cod_tip_operatiune": "30",
            "nr_bunuri": 1,
            "nr_documente": 1
        },
        "errors": [],
        "warnings": []
    },
    "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_invalidInvalid business JSON (missing/wrong field) or — at strict=true — a declaration that fails validation. The body carries error plus errors[]/warnings[].
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": "Invalid business JSON (missing/wrong field) or — at strict=true — a declaration that fails validation. The body carries error plus errors[]/warnings[].",
        "camp": "validate",
        "request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
    }
}