oneapi
Sign in
Anaf v1 / Declarații D

Read the declaration

The reverse of building: from a filed return it extracts the business data as JSON, with the same keys you would send to build.

POST
https://oneapi.ro/api/anaf/v1/declaratii/{form}/parse

Path parameters

NameTypeDescriptionExample
formrequired string Form code (D100, D112, D300, D394…). The full list is at /anaf/v1/declaratii/forms.

Request body

The request body is the whole document, sent raw (Content-Type: application/xml) — not an object with fields.

A filed D394

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

A filed D100

d100.xml application/xml · 0,4 KB — sent as is, in the request body.

A filed D390

d390.xml application/xml · 0,5 KB — sent as is, in the request body.

A filed D311

d311.xml application/xml · 0,4 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 a "D" declaration and returns the business JSON — the inverse of build.
  • Zero retention: parsing is stateless, in-memory.

What it is for

  • Reading a received/generated declaration, without writing an XML parser.

Response structure

FieldTypeDescription
data object The business JSON — the same shape that build accepts.
data.luna integer The month the data refers to.
data.an integer The year the data refers to.
data.tip_D394 string
data.op_efectuate boolean
data.declarant.cui string Tax identification number, without the RO prefix.
data.declarant.caen string The CAEN (NACE) code of the activity, in the series revision.
data.declarant.den string
data.declarant.adresa string The address, in the form published by the source.
data.declarant.telefon string
data.reprezentant.den string
data.reprezentant.functie string
data.reprezentant.adresa string The address, in the form published by the source.
data.intocmit.den string
data.intocmit.cif string
data.intocmit.calitate string
data.informatii.nrCui1 string
data.informatii.nrCui2 string
data.informatii.nrCui3 string
data.informatii.nrCui4 string
data.informatii.nr_BF_i1 string
data.informatii.incasari_i1 string
data.informatii.incasari_i2 string
data.informatii.nrFacturi_terti string
data.informatii.nrFacturi_benef string
data.informatii.nrFacturi string
data.informatii.nrFacturiL_PF string
data.informatii.nrFacturiLS_PF string
data.informatii.val_LS_PF string
data.informatii.tvaDedAI24 string
data.informatii.tvaDedAI21 string
data.informatii.tvaDedAI11 string
data.informatii.tvaDedAI20 string
data.informatii.tvaDedAI19 string
data.informatii.tvaDedAI9 string
data.informatii.tvaDedAI5 string
data.informatii.solicit string
data.rezumat1[].tip_partener string
data.rezumat1[].cota string
data.rezumat1[].facturiL string
data.rezumat1[].bazaL string
data.rezumat1[].tvaL string
data.rezumat2[].cota string
data.rezumat2[].bazaFSLcod string
data.rezumat2[].TVAFSLcod string
data.rezumat2[].bazaFSL string
data.rezumat2[].TVAFSL string
data.rezumat2[].bazaFSA string
data.rezumat2[].TVAFSA string
data.rezumat2[].bazaFSAI string
data.rezumat2[].TVAFSAI string
data.rezumat2[].bazaBFAI string
data.rezumat2[].TVABFAI string
data.rezumat2[].nrFacturiL string
data.rezumat2[].bazaL string
data.rezumat2[].tvaL string
data.rezumat2[].nrFacturiA string
data.rezumat2[].bazaA string
data.rezumat2[].tvaA string
data.rezumat2[].nrFacturiAI string
data.rezumat2[].bazaAI string
data.rezumat2[].tvaAI string
data.rezumat2[].bazaL_PF string
data.rezumat2[].tvaL_PF string
data.parteneri[].tip string
data.parteneri[].tip_partener integer
data.parteneri[].cota integer
data.parteneri[].cui string Tax identification number, without the RO prefix.
data.parteneri[].den string
data.parteneri[].nr_facturi integer
data.parteneri[].baza integer
data.parteneri[].tva integer
meta.generat_la string When the response was built (ISO 8601).

Response examples

body: @d394.xml

POSThttps://oneapi.ro/api/anaf/v1/declaratii/D394/parse
{
    "data": {
        "luna": 9,
        "an": 2026,
        "tip_D394": "L",
        "op_efectuate": true,
        "declarant": {
            "cui": "990000005",
            "caen": "6201",
            "den": "Exemplu Furnizor SRL",
            "adresa": "Cluj-Napoca, Str. Memorandumului 28",
            "telefon": "0264000000"
        },
        "reprezentant": {
            "den": "Exemplu Reprezentant",
            "functie": "Administrator",
            "adresa": "Cluj-Napoca, Str. Memorandumului 28"
        },
        "intocmit": {
            "den": "Exemplu Contabil",
            "cif": "990000005",
            "calitate": "administrator"
        },
        "informatii": {
            "nrCui1": "1",
            "nrCui2": "0",
            "nrCui3": "0",
            "nrCui4": "0",
            "nr_BF_i1": "0",
            "incasari_i1": "0",
            "incasari_i2": "0",
            "nrFacturi_terti": "0",
            "nrFacturi_benef": "0",
            "nrFacturi": "1",
            "nrFacturiL_PF": "0",
            "nrFacturiLS_PF": "0",
            "val_LS_PF": "0",
            "tvaDedAI24": "0",
            "tvaDedAI21": "0",
            "tvaDedAI11": "0",
            "tvaDedAI20": "0",
            "tvaDedAI19": "0",
            "tvaDedAI9": "0",
            "tvaDedAI5": "0",
            "solicit": "0"
        },
        "rezumat1": [
            {
                "tip_partener": "1",
                "cota": "21",
                "facturiL": "1",
                "bazaL": "700",
                "tvaL": "147"
            }
        ],
        "rezumat2": [
            {
                "cota": "21",
                "bazaFSLcod": "0",
                "TVAFSLcod": "0",
                "bazaFSL": "0",
                "TVAFSL": "0",
                "bazaFSA": "0",
                "TVAFSA": "0",
                "bazaFSAI": "0",
                "TVAFSAI": "0",
                "bazaBFAI": "0",
                "TVABFAI": "0",
                "nrFacturiL": "1",
                "bazaL": "700",
                "tvaL": "147",
                "nrFacturiA": "0",
                "bazaA": "0",
                "tvaA": "0",
                "nrFacturiAI": "0",
                "bazaAI": "0",
                "tvaAI": "0",
                "bazaL_PF": "0",
                "tvaL_PF": "0"
            }
        ],
        "parteneri": [
            {
                "tip": "L",
                "tip_partener": 1,
                "cota": 21,
                "cui": "990000072",
                "den": "Exemplu Client SRL",
                "nr_facturi": 1,
                "baza": 700,
                "tva": 147
            }
        ]
    },
    "meta": {
        "generat_la": "2026-10-06T23: 59: 41+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.
404negasitUnsupported form.
422xml_invalidXML that cannot be parsed or is not the expected form.
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 the expected form.",
        "camp": "form",
        "request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
    }
}