oneapi
Sign in
Anaf v1 / Declarații D

A form's fields

A form's contract, derived MECHANICALLY from the official XSD: the elements, each one's attributes, which are required and what values they accept. It is not hand-written, so it never falls behind the schema.

GET
https://oneapi.ro/api/anaf/v1/declaratii/{form}/campuri

Path parameters

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

Query parameters

This route accepts no query parameters.

How it behaves

  • Returns what the form is allowed to contain: its elements, the attributes of each, which ones are required, their type, which values are permitted (enumerations), which pattern must be matched, and the limits (lengths, min/max, decimals).
  • Everything is derived mechanically from the official ANAF XSD we validate against — not from documentation we rewrote. If the schema says cod_oblig accepts exactly 72 values, those are the ones you get. What the schema does not state does not appear here: we invent no labels.
  • It answers the question that most often stalls an integration: "I got a validation error and I do not know what I was allowed to send." Instead of digging through the ANAF form on paper, you ask for the contract.
  • Useful for generating a form in your own UI as well: you get the types, the required flags and the value lists, ready to bind to fields.

What it is for

  • Find out which codes cod_oblig (D100) accepts, or which rows the VAT return (D300) has, without opening the ANAF documentation.
  • Build a form dynamically in your UI, with local validation identical to the official schema.
  • Check before sending that your values fit the enumerations and patterns, so you do not get a 422.

Response structure

FieldTypeDescription
data.formular string The code of the described form.
data.schema string The official XSD file the description was derived from.
data.namespace string The form's XML namespace.
data.elemente object Element → {atribute, elemente_copil}. Each attribute: {nume, obligatoriu, tip, valori_permise, tipar, lungime_max, lungime_min, min, max, zecimale, implicit} (only the fields the schema actually constrains appear). elemente_copil gives the name and the occurrence range (0..n).
data.elemente.declaratie100.atribute[].nume string The name, exactly as the source publishes it.
data.elemente.declaratie100.atribute[].obligatoriu boolean
data.elemente.declaratie100.atribute[].tip string
data.elemente.declaratie100.atribute[].min string
data.elemente.declaratie100.atribute[].max string
data.elemente.declaratie100.elemente_copil[].nume string The name, exactly as the source publishes it.
data.elemente.declaratie100.elemente_copil[].aparitii string
data.elemente.obligatie.atribute[].nume string The name, exactly as the source publishes it.
data.elemente.obligatie.atribute[].obligatoriu boolean
data.elemente.obligatie.atribute[].tip string
data.elemente.obligatie.atribute[].valori_permise array
meta.generat_la string When the response was built (ISO 8601).

Response examples

GEThttps://oneapi.ro/api/anaf/v1/declaratii/D100/campuri
{
    "data": {
        "formular": "D100",
        "schema": "d100_v2.xsd",
        "namespace": "mfp:anaf:dgti:d100:declaratie:v2",
        "elemente": {
            "declaratie100": {
                "atribute": [
                    {
                        "nume": "luna",
                        "obligatoriu": true,
                        "tip": "integer",
                        "min": "1",
                        "max": "12"
                    }
                ],
                "elemente_copil": [
                    {
                        "nume": "obligatie",
                        "aparitii": "1..1300"
                    }
                ]
            },
            "obligatie": {
                "atribute": [
                    {
                        "nume": "cod_oblig",
                        "obligatoriu": true,
                        "tip": "integer",
                        "valori_permise": [
                            "102",
                            "103",
                            "106",
                            "105",
                            "150",
                            "121",
                            "122",
                            "710",
                            "611",
                            "615",
                            "616",
                            "614",
                            "604",
                            "605",
                            "609",
                            "617",
                            "606",
                            "608",
                            "620",
                            "613",
                            "690",
                            "612",
                            "140",
                            "810",
                            "750",
                            "755",
                            "756",
                            "780",
                            "111",
                            "211",
                            "216",
                            "212",
                            "217",
                            "213",
                            "214",
                            "215",
                            "221",
                            "222",
                            "224",
                            "225",
                            "231",
                            "232",
                            "233",
                            "234",
                            "235",
                            "236",
                            "238",
                            "237",
                            "270",
                            "244",
                            "242",
                            "243",
                            "261",
                            "275",
                            "504",
                            "945",
                            "941",
                            "942",
                            "943",
                            "944",
                            "510",
                            "535",
                            "619",
                            "450",
                            "758",
                            "621",
                            "781",
                            "711",
                            "712",
                            "713",
                            "130",
                            "607"
                        ]
                    }
                ]
            }
        }
    },
    "meta": {
        "generat_la": "2026-10-06T23: 59: 41+03: 00"
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403modul_interzisThe token has no access to the route's module.
404negasitUnknown form — see GET /anaf/v1/declaratii/forms.
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": "negasit",
        "mesaj": "Unknown form — see GET /anaf/v1/declaratii/forms.",
        "camp": "form",
        "request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
    }
}