oneapi
Sign in
Carburanti v1 / Carburanti

Cost of a refuelling or a trip

POST, because the input (kilometres driven, consumption, quantity) describes the client's activity and has no business in access logs or in the browser history.

POST
https://oneapi.ro/api/carburanti/v1/decont

Request body

Sent as JSON in the request body (Content-Type: application/json) — not in the query string.

NameTypeDescriptionAccepted values
taraoptional string | null Country code for the reference price. Defaults to RO. ATBEBGCYCZDEDKEEESFIFRGRHRHUIEITLTLULVMTNLPLPTROSESISKUKEUEA
produsrequired string Product code. Required: the reimbursement uses the price of the product refuelled. benzina95motorinamotorina_incalzirepacura_sulf_micpacura_sulf_maregpl
dataoptional string | null The date of the price used, YYYY-MM-DD. Defaults to the most recent week.
litrioptional number | null Litres consumed. Either this, or the km + consum_litri_la_100km pair. 1000000
kmoptional number | null Kilometres driven, used together with consum_litri_la_100km. 1000000
consum_litri_la_100kmoptional number | null Average consumption, litres per 100 km. 200
A trip by kilometres Request body
{
    "produs": "motorina",
    "km": 420,
    "consum_litri_la_100km": 6.5
}
A refuel on a past date Request body
{
    "produs": "benzina95",
    "litri": 45,
    "data": "2022-03-14"
}
A refuel in another country Request body
{
    "produs": "benzina95",
    "litri": 50,
    "tara": "HU"
}
A long trip, higher consumption Request body
{
    "produs": "motorina",
    "km": 1200,
    "consum_litri_la_100km": 7.2
}

Query parameters

This route accepts no query parameters.

How it behaves

  • The method is POST because the input describes the client activity — kilometres driven, consumption, quantity — and has no place in access logs or browser history.
  • The request body has: produs (required), tara, data, and either litri or km together with consum_litri_la_100km. The two paths are mutually exclusive: if both were accepted, one would have to be silently chosen, and the amount in the claim would depend on a convention you cannot see. Body fields do not appear in the parameter table — that one documents the query string only.
  • total is computed from the published price. din_care is a reconstruction from components, and din_care.insumeaza_totalul says whether they actually add up to total. When it is false, do not force the equality: the published price is the right figure, the components are indicative for that week.
  • Only products with a per-litre price can be settled. Fuel oil, published per tonne, returns 404.
  • The amount is a calculation basis defensible against a public source, not an invoice and not the price actually paid at a particular station.

What it is for

  • Compute the value of a travel claim at the official price of the week it happened, not at today price.
  • Verify an expense note: how many litres and what amount it should have been, given the declared mileage and the vehicle consumption.
  • Estimate a fleet fuel budget from mileage and average consumption.

Response structure

All fields below live inside data.

FieldTypeDescription
tara string Țara folosită.
produs string Produsul.
denumire string Denumirea lizibilă.
saptamana string Săptămâna de preț folosită.
ceruta string Data cerută.
moneda string Moneda tuturor sumelor din răspuns.
cantitate.litri number Litrii folosiți la calcul.
cantitate.dedusa_din_distanta boolean true dacă litrii au fost calculați din km și consum.
cantitate.km number Distanța trimisă, dacă a fost trimisă.
cantitate.consum_litri_la_100km number Consumul trimis, dacă a fost trimis.
pret_pe_litru number Prețul publicat pe litru, cu taxe.
total number Suma de decontat: litri × preț publicat pe litru.
din_care.fara_taxe number Partea fără taxe, reconstruită.
din_care.acciza number Acciza inclusă, reconstruită.
din_care.tva number TVA-ul inclus, reconstruit.
din_care.insumeaza_totalul boolean Dacă cele trei componente adună exact la total.
din_care.atentie string Prezent doar când componentele nu însumează totalul, cu explicația.
reconciliere object Aceeași structură ca la GET /taxe.
sursa object Sursa, licența și avertismentul că e preț mediu național.

Response examples

body: {"produs": "motorina", "km": 420, "consum_litri_la_100km": 6.5}

POSThttps://oneapi.ro/api/carburanti/v1/decont
{
    "data": {
        "tara": "RO",
        "produs": "motorina",
        "denumire": "Motorină auto",
        "saptamana": "2026-09-14",
        "ceruta": "2026-09-14",
        "moneda": "RON",
        "cantitate": {
            "litri": 27.3,
            "dedusa_din_distanta": true,
            "km": 420,
            "consum_litri_la_100km": 6.5
        },
        "pret_pe_litru": 10.512,
        "total": 286.98,
        "din_care": {
            "fara_taxe": 179.75,
            "acciza": 57.42,
            "tva": 49.81,
            "insumeaza_totalul": true
        },
        "reconciliere": {
            "posibila": true,
            "pret_publicat": 10511.99,
            "abatere_procent": 0,
            "se_inchide": true,
            "observatie": "Defalcarea reproduce prețul publicat; diferența rămasă vine din rotunjiri și din medierea săptămânală."
        },
        "sursa": {
            "nume": "European Commission — Weekly Oil Bulletin (DG ENER)",
            "licenta": "CC BY 4.0 (Decizia 2011/833/UE)",
            "observatie": "Preț mediu național pentru săptămâna indicată, nu prețul unei stații anume. Suma e o bază de calcul justificabilă, nu o factură."
        }
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
404negasitNo per-litre price for the requested combination, or the product is published per tonne.
422validareprodus is missing, or the quantity is not given correctly (neither litri nor the km + consum_litri_la_100km pair, or both at once).
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": "produs is missing, or the quantity is not given correctly (neither litri nor the km + consum_litri_la_100km pair, or both at once)."
    }
}