OCPI 2.2.1
Une API qui calcule le prix d'un CDR, estime une session en cours, valide et explique vos tarifs, et conserve vos tarifs OCPI 2.2.1 dans un historique de révisions immuable. An API that prices a CDR, estimates an in-progress session, validates and explains your tariffs, and stores OCPI 2.2.1 tariffs with an immutable revision history.
curl -sS https://tariff.ocpi.tech/api/v1/prices/estimate \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{"start_date_time":"2026-07-26T18:30:00Z", "elapsed_time_hours":1.5,"energy_kwh":32, "currency":"EUR","tariff_source":"override", "tariffs":[…]}' { "total": { "excl_vat": "14.4000", "incl_vat": "17.2800" }, "ocpi_version": "2.2.1", "warnings": [] }
Appels réels vers cette API depuis votre navigateur. Live calls to this API from your browser.
EntréeInput
Tarif OCPIOCPI tariff
Request
Choisissez un tarif, puis lancez la requête. Pick a tariff, then run the request.
Un wrapper HTTP autour de ocpi-tariffs, avec stockage de tarifs versionné. An HTTP wrapper around ocpi-tariffs, with versioned tariff storage.
/prices/cdr
Y compris les CDR non tarifés reçus des systèmes de supervision. Le CDR renvoyé porte les montants recalculés. Including unpriced CDRs from supervision systems. The returned CDR carries recalculated amounts.
/prices/validate
Compare les montants d'un CDR reçu avec un calcul frais et liste les écarts champ par champ. Compares a received CDR's amounts with a fresh calculation and lists differences field by field.
/prices/session · /estimate
Coût courant d'une session en cours, depuis une Session OCPI complète ou de simples métriques — courbe de charge incluse. Running cost of an in-progress session, from a full OCPI Session or minimal metrics — charge curve included.
/tariffs/validate
Détecte les restrictions inatteignables, les dimensions manquantes et les incohérences avant publication. Catches unreachable restrictions, missing dimensions and inconsistencies before publication.
/tariffs/explain
Transforme un objet Tariff en texte lisible — Markdown multilingue, prêt pour une app conducteur. Turns a Tariff object into readable text — multilingual Markdown, ready for a driver app.
/ocpi/*/2.2.1/tariffs
Routes sender et receiver OCPI 2.2.1, avec un historique de révisions immuable et un cloisonnement par party. Les autres versions du protocole sont hors périmètre : elles relèvent du service ocpi-gateway. OCPI 2.2.1 sender and receiver routes, with an immutable revision history and per-party isolation. Other protocol versions are out of scope — they belong to the separate ocpi-gateway service.
Trois appels pour passer d'un token à un tarif stocké et facturable. Three calls to go from a token to a stored, billable tariff.
01
Un token est lié à une audience — api pour les routes de calcul, ocpi pour les routes protocolaires — et à l'ensemble de parties OCPI de votre tenant. A token is bound to an audience — api for pricing routes, ocpi for protocol routes — and to your tenant's set of OCPI parties.
curl -sS https://tariff.ocpi.tech/health { "status": "ok", "version": "0.2.0" }
02
Le CDR peut porter son propre tarif (tariff_source: "cdr"), un tarif fourni en ligne, ou une révision stockée. The CDR can carry its own tariff (tariff_source: "cdr"), an inline tariff, or a stored revision.
curl -sS -X POST https://tariff.ocpi.tech/api/v1/prices/cdr \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{"cdr": {…}, "tariff_source": "cdr"}'
03
Chaque PUT crée une révision immuable. Le calcul peut ensuite citer la révision exacte utilisée. Each PUT creates an immutable revision. Pricing can then cite the exact revision used.
curl -sS -X PUT \ https://tariff.ocpi.tech/ocpi/receiver/2.2.1/tariffs/FR/ECL/simple-kwh \ -H 'Authorization: Token <base64(token)>' \ -H 'Content-Type: application/json' \ -d @tariff.json
Vos bornes remontent des sessions non tarifées. Le service produit le CDR facturable, applique le bon tarif au bon créneau, et garde la révision exacte qui a servi au calcul. Your chargers report unpriced sessions. The service produces the billable CDR, applies the right tariff to the right window, and keeps the exact revision used for the calculation.
/prices/cdr
/ocpi/receiver/2.2.1/tariffs
Affichez un coût courant fiable pendant la charge, et un tarif lisible avant de brancher — sans réimplémenter la spec OCPI dans votre app. Show a reliable running cost during charging, and a readable tariff before plugging in — without reimplementing the OCPI spec in your app.
/prices/session
/tariffs/explain
Réconciliez les CDR de vos partenaires : recalcul indépendant, écarts listés champ par champ, tarif de référence versionné en cas de litige. Reconcile partner CDRs: independent recalculation, differences listed field by field, versioned reference tariff when a dispute arises.
/prices/validate
/tariffs/…/revisions