oneapi
Sign in
Identificatori v1 / Identificatori

Validate an identifier

A single validation, straight in the path: the type and the value. It returns whether it is valid, the normalised form and whatever could be read out of the code.

GET
https://oneapi.ro/api/identificatori/v1/{tip}/{valoare}

Path parameters

NameTypeDescriptionExample
tiprequired string Identifier type (cnp, cui, iban, bic, lei, eori, vat…). The full list is at /identificatori/v1/tipuri.
valoarerequired string The value to validate, as printed on the document. Spaces and hyphens are ignored.

Query parameters

This route accepts no query parameters.

How it behaves

  • One route for every type, with the type as a path segment. Ten near-identical routes would be ten places to maintain for the same behaviour, and the catalogue at /tipuri describes them all anyway.
  • The personal numeric code cannot be requested here. The route answers 405 and points to POST /identificatori/v1/cnp: in a URL the code would land in the server access logs, the browser history and the next page's Referer header.
  • The response has the same shape for every type: valid, motive (sentences, not error codes) and componente (whatever could be decoded). Someone validating an IBAN today and an ISIN tomorrow need not learn two shapes.
  • What we do NOT check, by type: for IBAN, the expected length outside Romania — that table is the SWIFT registry, and every library carrying it is LGPL; the mod-97 check digit is however complete. For BIC, the existence of the institution — the registry is a commercial SWIFT product. For VIN, make and model — the manufacturer code list is held by SAE. Each response says so in observatie, not just the documentation.

What it is for

  • Reject a mistyped IBAN in a form, before initiating a payment.
  • Check a scanned EAN code, to catch a bad barcode read.
  • Decode a VIN to find the model year and manufacturing region.
  • Confirm the check digit of a Romanian VAT number before running a lookup that would find nothing anyway.

Response structure

All fields below live inside data.

FieldTypeDescription
tip string The type used for validation.
valoare string The value received, exactly as sent.
valid boolean Whether the identifier is well formed under its standard.
normalizat string The canonical form (no separators, upper case), present only when valid.
componente object Whatever could be decoded — differs by type.
componente.tara string The country the value refers to.
componente.tara_nume string
componente.cifre_control string
componente.lungime integer
componente.lungime_verificata boolean
componente.format_afisare string
componente.cod_banca string
componente.cont string
motive What exactly is wrong, in words. Absent when valid.
observatie string The concrete limit of the check for that type.

Response examples

GEThttps://oneapi.ro/api/identificatori/v1/iban/RO49AAAA1B31007593840000
{
    "data": {
        "tip": "iban",
        "valoare": "RO49AAAA1B31007593840000",
        "valid": true,
        "normalizat": "RO49AAAA1B31007593840000",
        "componente": {
            "tara": "RO",
            "tara_nume": "România",
            "cifre_control": "49",
            "lungime": 24,
            "lungime_verificata": true,
            "format_afisare": "RO49 AAAA 1B31 0075 9384 0000",
            "cod_banca": "AAAA",
            "cont": "1B31007593840000"
        }
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
404negasitThe requested type does not exist. The list is at /identificatori/v1/tipuri.
405eroareType cnp was requested, which is accepted only via POST.
429cota_depasitaThe plan's monthly quota has been exceeded (see Retry-After).

All errors share the same shape. eroare.cod is stable and is the value you should branch on in code — not the text in mesaj, which may change.

{
    "eroare": {
        "cod": "negasit",
        "mesaj": "The requested type does not exist. The list is at /identificatori/v1/tipuri."
    }
}