Set what drivers pay
Create tariffs with energy, time and session prices, assign them to a project, location, charger or outlet, and read what every session cost.
On this page
A tariff is the price a driver pays to charge: per kWh, per minute, per session, with night rates, weekday rates and different prices for AC and DC. Assign it once to a project, a location, a charger or a single outlet, and Flowion prices every session there, while it runs and after it ends.
A tariff is what drivers pay you. What a site pays its electricity supplier is a supply contract, and the two never mix.
Create a tariff
The answer is 201 with the tariff, "version": 1. tariffId is your own name for it: 1 to 60 letters, digits, ., _, : or -. Leave it out and Flowion assigns one.
Only currency is required. A tariff charges for whichever parts you include:
| Part | Price field | Charged |
|---|---|---|
energy | priceKwh | Per kWh delivered |
chargingTime | priceMinute | Per minute spent charging |
idleTime | priceMinute | Per minute plugged in without charging |
fixedFee | priceFixed | Once per session |
minCost, maxCost | exclTax, inclTax | A floor and a ceiling on the total |
Every price is a decimal string before tax. taxRates on each part adds tax on top: tax is a percentage, and when a part has several rates, stack sets the order they compound in, from 0. description holds the tariff's text for drivers, one entry per language.
Price by time, day or charger type
Each part takes a list of prices, and a price can carry conditions. The first price in the list whose conditions all hold is the one that applies. A price with no conditions always holds, so put it last as the fallback.
"energy":
That reads: 2.50 at night on any charger, 4.50 for fast DC charging during the day, 3.50 otherwise. A window whose end is before its start runs past midnight.
Conditions you can price on:
| Condition | Holds |
|---|---|
startTimeOfDay, endTimeOfDay | Between two local times, HH:MM |
dayOfWeek | On the listed days, "Monday" to "Sunday" |
validFromDate, validToDate | Between two dates |
evseKind | On "AC" or "DC" outlets |
minEnergy, maxEnergy | Once the session has delivered so much energy |
minChargingTime, minIdleTime, minTime, and their max pairs | Once the session has run so long |
Times and days are read on the charger's local clock: its location's time zone, or the project's when the location has none. A tariff with a time or day condition needs the project to have a time zone, and answers 422 timeZoneRequired until it does. Set it with PATCH /v1/organizations/{organizationId}/projects/{projectId} and {"timeZone": "Europe/Stockholm"}.
Change a price
Send the tariff again with the same tariffId. Every edit creates a new version, and assignments follow the tariff, so the new price applies everywhere it is assigned straight away.
lists every version, newest first, and GET /v1/projects/{id}/tariffs the latest version of each tariff.
Assign it
200Response
Send exactly one of projectId, locationId, chargingStationId or evseId (one outlet); none or more than one is 400. The most specific assignment wins: an outlet's own tariff, then its charger's, then its location's, then the project's. Assign a default to the project and override only where prices differ.
GET /v1/projects/{id}/tariff-assignments lists every assignment in the project, each with an assignmentId. DELETE /v1/projects/{id}/tariff-assignments/{assignmentId} removes one, and the level above applies again.
A tariff assigned to a charger is also installed on the charger itself, for chargers that show prices to drivers, and kept there. dispatchOutcome in the answer is the charger's reply, and GET /v1/charging-stations/{id}/tariffs asks the charger what it holds right now. Not supported on every charger. See which.
Show a location's prices by the hour
For a price board in your app, ask for one local day:
200Response
hours has all 24 hours of the day on the location's clock, each with the energy price before tax for AC and for DC outlets, under the tariff the location's chargers inherit. nowHour marks the current hour when the date is today. outcome is noTariff when nothing is assigned, and zoneUnknown when the tariff prices by time of day and there is no time zone to read it in.
How a session's cost is worked out
Flowion prices a session period by period. Wherever the price that applies changes during a session, at 22:00 or after the first 20 kWh, a new period begins, and each period is priced at its own rate. A session plugged in at 21:00 pays the day rate until 22:00 and the night rate after it.
Then, in order:
Each part (energy, charging time, idle time) is the sum of its periods.
The fixed fee is added once, at the price that held when the session started.
Each part's tax is applied.
minCostandmaxCostlift or cap the total, compared with the total including tax.
Read the result for any session, running or ended:
The answer, and the two cases where there is no price yet, are explained in Track sessions, energy and cost.