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_obligaccepts 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"
}
}
GEThttps://oneapi.ro/api/anaf/v1/declaratii/D300/campuri
{
"data": {
"formular": "D300",
"schema": "d300_v12.xsd",
"namespace": "mfp:anaf:dgti:d300:declaratie:v12",
"elemente": {
"declaratie300": {
"atribute": [
{
"nume": "luna",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "12"
}
]
}
}
},
"meta": {
"generat_la": "2026-10-06T23: 59: 41+03: 00"
}
}
GEThttps://oneapi.ro/api/anaf/v1/declaratii/D394/campuri
{
"data": {
"formular": "D394",
"schema": "d394_v5.xsd",
"namespace": "mfp:anaf:dgti:d394:declaratie:v5",
"elemente": {
"declaratie394": {
"atribute": [
{
"nume": "luna",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "12"
}
],
"elemente_copil": [
{
"nume": "informatii",
"aparitii": "1..1"
}
]
},
"informatii": {
"atribute": [
{
"nume": "nrCui1",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"rezumat1": {
"atribute": [
{
"nume": "tip_partener",
"obligatoriu": true,
"tip": "integer",
"valori_permise": [
"1",
"2",
"3",
"4"
]
}
],
"elemente_copil": [
{
"nume": "detaliu",
"aparitii": "0..n"
}
]
},
"rezumat2": {
"atribute": [
{
"nume": "cota",
"tip": "integer",
"valori_permise": [
"5",
"9",
"19",
"20",
"24",
"21",
"11"
]
}
]
},
"serieFacturi": {
"atribute": [
{
"nume": "tip",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "4"
}
]
},
"lista": {
"atribute": [
{
"nume": "caen",
"obligatoriu": true,
"tip": "integer",
"valori_permise": [
"1071",
"4520",
"4730",
"47761",
"47762",
"4932",
"55101",
"55102",
"56103",
"5630",
"812",
"9313",
"9602",
"9603"
]
}
]
},
"facturi": {
"atribute": [
{
"nume": "tip_factura",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "4"
}
]
},
"op1": {
"atribute": [
{
"nume": "tip",
"obligatoriu": true,
"tip": "string",
"valori_permise": [
"A",
"L",
"C",
"V",
"LS",
"AS",
"AI",
"N"
],
"lungime_max": 256
}
],
"elemente_copil": [
{
"nume": "op11",
"aparitii": "0..n"
}
]
},
"op2": {
"atribute": [
{
"nume": "tip_op2",
"obligatoriu": true,
"tip": "string",
"valori_permise": [
"I1",
"I2"
],
"lungime_max": 256
}
]
},
"detaliu": {
"atribute": [
{
"nume": "bun",
"obligatoriu": true,
"tip": "integer",
"valori_permise": [
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
"32",
"33",
"34",
"35",
"36"
]
}
]
},
"op11": {
"atribute": [
{
"nume": "nrFactPR",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
}
}
},
"meta": {
"generat_la": "2026-10-06T23: 59: 41+03: 00"
}
}
GEThttps://oneapi.ro/api/anaf/v1/declaratii/D112/campuri
{
"data": {
"formular": "D112",
"schema": "d112_v6.xsd",
"namespace": "mfp:anaf:dgti:declaratie_unica:declaratie:v6",
"elemente": {
"declaratieUnica": {
"atribute": [
{
"nume": "luna_r",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "12"
}
],
"elemente_copil": [
{
"nume": "angajator",
"aparitii": "1..1"
}
]
},
"angajator": {
"atribute": [
{
"nume": "cif",
"obligatoriu": true,
"tip": "token",
"tipar": "[1-9]\\d{12}|[1-9]\\d{1,9}"
}
],
"elemente_copil": [
{
"nume": "angajatorA",
"aparitii": "1..29"
}
]
},
"asigurat": {
"atribute": [
{
"nume": "idAsig",
"obligatoriu": true,
"tip": "string",
"lungime_max": 6
}
],
"elemente_copil": [
{
"nume": "det1",
"aparitii": "0..10"
}
]
},
"angajatorA": {
"atribute": [
{
"nume": "A_codBugetar",
"obligatoriu": true,
"tip": "string",
"valori_permise": [
"20470101XX",
"5502XXXXXX"
],
"lungime_max": 10
}
]
},
"angajatorB": {
"atribute": [
{
"nume": "B_cnp",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999"
}
]
},
"angajatorC1": {
"atribute": [
{
"nume": "C1_11",
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"angajatorC2": {
"atribute": [
{
"nume": "C2_11",
"tip": "integer",
"min": "0",
"max": "999999"
}
]
},
"angajatorC3": {
"atribute": [
{
"nume": "C3_11",
"tip": "integer",
"min": "0",
"max": "999999"
}
]
},
"angajatorC4": {
"atribute": [
{
"nume": "C4_baza",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"angajatorC5": {
"atribute": [
{
"nume": "C5_baza",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"angajatorD": {
"atribute": [
{
"nume": "D2",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999"
}
]
},
"angajatorE1": {
"atribute": [
{
"nume": "E1_venit",
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"angajatorE2": {
"atribute": [
{
"nume": "E2_11",
"tip": "integer",
"min": "0",
"max": "999999"
}
]
},
"angajatorE3": {
"atribute": [
{
"nume": "E3_11",
"tip": "integer",
"min": "0",
"max": "999999"
}
]
},
"angajatorE4": {
"atribute": [
{
"nume": "E4_1",
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"angajatorF1": {
"atribute": [
{
"nume": "F1_suma",
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"angajatorF2": {
"atribute": [
{
"nume": "F2_cif",
"obligatoriu": true,
"tip": "token",
"tipar": "[1-9]\\d{1,9}"
}
]
},
"det1": {
"atribute": [
{
"nume": "detasat",
"tip": "integer",
"min": "1",
"max": "6"
}
]
},
"coAsigurati": {
"atribute": [
{
"nume": "tip",
"obligatoriu": true,
"tip": "string",
"valori_permise": [
"P",
"S"
],
"lungime_max": 1
}
]
},
"asiguratE4": {
"atribute": [
{
"nume": "nr_ctr",
"tip": "string",
"lungime_max": 30
}
]
},
"asiguratA": {
"atribute": [
{
"nume": "A_1",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "49"
}
]
},
"asiguratA1": {
"atribute": [
{
"nume": "A_11i",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"asiguratB1": {
"atribute": [
{
"nume": "B1_1",
"obligatoriu": true,
"tip": "integer",
"min": "1",
"max": "49"
}
]
},
"asiguratB2": {
"atribute": [
{
"nume": "B2_1",
"tip": "integer",
"min": "0",
"max": "19"
}
]
},
"asiguratB3": {
"atribute": [
{
"nume": "B3_1",
"tip": "integer",
"min": "0",
"max": "99"
}
]
},
"asiguratB4": {
"atribute": [
{
"nume": "B4_1",
"tip": "integer",
"min": "0",
"max": "99"
}
]
},
"asiguratB41": {
"atribute": [
{
"nume": "B4_5i",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"asiguratC": {
"atribute": [
{
"nume": "C_1",
"obligatoriu": true,
"tip": "integer",
"valori_permise": [
"1",
"2",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"13",
"14",
"15",
"16",
"17",
"22",
"26",
"27",
"28",
"29",
"30",
"31",
"32",
"33",
"34"
]
}
]
},
"asiguratD": {
"atribute": [
{
"nume": "D_1",
"obligatoriu": true,
"tip": "string",
"lungime_max": 5
}
]
},
"asiguratE1": {
"atribute": [
{
"nume": "E1_1",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"asiguratE2": {
"atribute": [
{
"nume": "E2_1",
"obligatoriu": true,
"tip": "integer",
"min": "0",
"max": "999999999999999"
}
]
},
"asiguratE3": {
"atribute": [
{
"nume": "E3_1",
"obligatoriu": true,
"tip": "string",
"valori_permise": [
"A",
"B",
"C"
]
}
]
}
}
},
"meta": {
"generat_la": "2026-10-06T23: 59: 41+03: 00"
}
}
Error codes
| Code | Slug | When it occurs |
|---|---|---|
| 401 | neautentificat | Token missing, invalid, expired or revoked. |
| 403 | modul_interzis | The token has no access to the route's module. |
| 404 | negasit | Unknown form — see GET /anaf/v1/declaratii/forms. |
| 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": "negasit",
"mesaj": "Unknown form — see GET /anaf/v1/declaratii/forms.",
"camp": "form",
"request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
}
}