oneapi
Sign in
Financiar v1 / Calendar

Working days in an interval

The number of working days between two dates, both included, with the breakdown the figure follows from. Without pana_la, the interval ends today. With sector=public, the bridge days set by Government Decision are subtracted.

GET
https://oneapi.ro/api/financiar/v1/zile-lucratoare

Query parameters

NameTypeDescriptionAccepted values
de_larequired string Required, YYYY-MM-DD. Included in the count. e.g. 2024-06-15e.g. 2024-06
pana_laoptional string | null Optional, defaults to today. Included in the count. e.g. 2024-06-15e.g. 2024-06-30
sectoroptional string | null privat (default) or public. Decides whether Government bridge days are subtracted. privatpublic

How it behaves

  • The number of working days between two dates, both included: a single working day requested as de_la = pana_la returns 1.
  • Without pana_la, the interval ends today — the same convention as /curs/interval. The completion is reported in meta.implicit, so it is not a silent assumption.
  • The response carries the breakdown, not just the figure: calendar − weekend − holidays(on working days) − bridge days = working days. The identity closes exactly, so the result is verifiable without reproducing the logic.
  • Holidays falling at a weekend are NOT subtracted separately: they are already counted in the weekend. In August 2026, the Assumption falls on a Saturday — subtracted twice, it would give 20 working days instead of 21. That is why the field is named sarbatori_in_zile_lucratoare.
  • sector decides what happens to bridge days set by Government decision. Default privat: bridge days for public-sector staff are ignored. With sector=public they are subtracted — for a public institution, 2 May 2025 was not a working day. A count cannot answer "it depends", so the assumption is requested and declared in the response.
  • Only bridge days that would otherwise have been working days are subtracted. A bridge day adjacent to a holiday, or falling at a weekend, subtracts nothing — otherwise the identity would break precisely in the years when bridge days extend a holiday.

What it is for

  • Computing the working days in a month, for payroll.
  • Checking a contractual term expressed in working days.
  • How many working days have passed from a date until today.

Response structure

FieldTypeDescription
data.de_la string Start of the interval the response covers.
data.pana_la string End of the interval the response covers, inclusive.
data.sector string Institutional or economic sector.
data.zile_lucratoare integer The result: Monday-to-Friday days that are not public holidays (minus bridge days, with sector=public).
data.defalcare.zile_calendaristice integer All days in the interval, both ends included.
data.defalcare.zile_weekend integer How many Saturdays and Sundays fall in the interval.
data.defalcare.sarbatori_in_zile_lucratoare integer Public holidays falling Monday to Friday. Only these reduce the count.
data.defalcare.punti_hg_scazute integer Government bridge days subtracted. Always 0 with sector=privat.
meta[] object[] The response envelope: the source, the freshness and the notes that go with the data.
meta.verificare string The arithmetic identity, written out, so the result can be confirmed at a glance.
meta.implicit array Parameters filled in by the server. Appears only when pana_la was omitted.

Response examples

GEThttps://oneapi.ro/api/financiar/v1/zile-lucratoare?de_la=2024-06-15
{
    "data": {
        "de_la": "2024-06-15",
        "pana_la": "2026-10-07",
        "sector": "privat",
        "zile_lucratoare": 578,
        "defalcare": {
            "zile_calendaristice": 845,
            "zile_weekend": 242,
            "sarbatori_in_zile_lucratoare": 25,
            "punti_hg_scazute": 0
        }
    },
    "meta": {
        "verificare": "845 − 242 − 25 − 0 = 578",
        "implicit": [
            "pana_la"
        ],
        "temei": "art. 139 Codul Muncii (sărbători legale).",
        "nota": "Sector privat: punţile de HG pentru bugetari NU se scad. Foloseşte `sector=public` pentru instituţii publice."
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
422validarede_la missing or malformed, pana_la before de_la, year outside 1990–2100, sector with another value. If de_la is in the future and pana_la is omitted, the message explicitly asks for pana_la instead of talking about a parameter that was never sent.
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": "validare",
        "mesaj": "de_la missing or malformed, pana_la before de_la, year outside 1990–2100, sector with another value. If de_la is in the future and pana_la is omitted, the message explicitly asks for pana_la instead of talking about a parameter that was never sent.",
        "detalii": {
            "de_la": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}