The OCPI Tariffs module is how a Charge Point Operator (coming soon) tells an eMSP what charging costs. The CPO publishes Tariff objects, each Connector in the Locations module points at the tariffs that apply to it, and the eMSP uses them to quote a price before the session and to check the bill after it. This page is the reference for the object and the endpoints in OCPI 2.2.1: every field with its required flag, the rule that decides which tariff element applies, a complete JSON example that parses, and the mistakes that produce wrong bills. Each statement below was checked against the 2.2.1 Tariffs module text. The pricing arithmetic of each dimension and step_size rounding has its own page, OCPI tariff dimensions in depth.

What the OCPI Tariffs module covers

  • Module identifier: tariffs. Data owner: CPO.
  • Sender interface (CPO): a paginated GET list, so a receiver can do a full sync.
  • Receiver interface (eMSP, NSP): GET, PUT and DELETE on a single Tariff.
  • Advised direction: push from CPO to eMSP during normal operation. The pull side exists for the first sync after a connection is set up, and for when the receiver is not sure its cache is current. OCPI pull vs push patterns covers how to combine the two.

Tariffs sit next to three other modules. Connectors in Locations carry tariff_ids; the Locations Receiver interface is formally dependent on Tariffs. A CDR carries a tariffs list with the tariffs relevant to that session, and each charging period names its tariff_id. Sessions charging preferences decide which tariff type applies. If the roles are new to you, start with what OCPI is.

The nesting is three levels deep, and knowing which level holds what is most of the module:

flowchart TB
    T[Tariff: currency, type, validity dates]
    T --> E1[Element 1: off-peak]
    T --> E2[Element 2: default, no restrictions]
    E1 --> R1[restriction: 22:00 to 06:00]
    E1 --> P1[ENERGY 0.30 EUR per kWh]
    E2 --> P2[FLAT 0.50 EUR per session]
    E2 --> P3[ENERGY 0.55 EUR per kWh]
    E2 --> P4[PARKING_TIME 6.00 EUR per hour]
    style T fill:#dbeafe,stroke:#2563eb
    style E1 fill:#fef3c7,stroke:#d97706
    style E2 fill:#fef3c7,stroke:#d97706

The Tariff object: every field

Cardinality follows the spec: 1 required, ? optional, * optional list, + list with at least one entry.

FieldTypeCard.What to know
country_codeCiString(2)1ISO 3166-1 alpha-2 of the owning CPO
party_idCiString(3)1The owning CPO’s party ID
idCiString(36)1Unique only within that CPO’s platform
currencystring(3)1ISO 4217, one currency per Tariff
typeTariffType?AD_HOC_PAYMENT, PROFILE_CHEAP, PROFILE_FAST, PROFILE_GREEN, REGULAR. Omitted means valid for all sessions
tariff_alt_textDisplayText*Human-readable text per language (language, text)
tariff_alt_urlURL?Page explaining the tariff, useful for dynamic prices
min_pricePrice?Session costs at least this (excl_vat required, incl_vat optional)
max_pricePrice?Session never costs more than this
elementsTariffElement+The pricing rules, in order
start_date_timeDateTime?UTC instant the tariff becomes active
end_date_timeDateTime?UTC instant after which it is no longer valid
energy_mixEnergyMix?Same structure as on a Location
last_updatedDateTime1Move it forward on every change

Inside elements, a TariffElement has price_components (PriceComponent, +) and restrictions (TariffRestrictions, ?). A PriceComponent has four fields:

FieldTypeCard.Meaning
typeTariffDimensionType1ENERGY, FLAT, PARKING_TIME or TIME
pricenumber1Price per unit, excluding VAT
vatnumber?VAT percentage. Omitted means no VAT applies, which is not the same as 0.0
step_sizeint1Billing block, rounded up to the next multiple

The units are where most bugs start:

DimensionPrice unitstep_size unit
ENERGYper kWh1 Wh
TIME (charging)per hour1 second
PARKING_TIME (not charging)per hour1 second
FLATper sessionnone

TariffRestrictions fields are all optional, and when several are set they combine as a logical AND:

FieldUnit and boundary
start_time, end_timeLocal HH:MM using the Location’s time_zone. If end is earlier than start, the window wraps past midnight
start_date, end_dateLocal YYYY-MM-DD, start inclusive, end exclusive
min_kwh, max_kwhEnergy consumed in the session, min inclusive, max exclusive
min_current, max_currentAmperes summed over all phases, at this moment
min_power, max_powerkW, at this moment
min_duration, max_durationSeconds of session duration
day_of_weekList of MONDAY to SUNDAY
reservationRESERVATION or RESERVATION_EXPIRES; the element then prices the reservation, with only FLAT and TIME allowed

How OCPI picks the tariff element that applies

This is the rule that the JSON alone does not show you, and the spec states it precisely. For each dimension separately, the first Tariff Element in the list that contains a Price Component for that dimension and whose restrictions match is used. Only one Price Component per dimension is active at any moment, but different dimensions can be active at once and can come from different elements.

Three consequences follow:

  1. Order matters, and the default goes last. An element with no restrictions always matches. Place it first and every later element for the same dimension is unreachable. The spec advises a default per dimension, placed after all other elements for that dimension.
  2. No match means no charge for that dimension. If nothing matches and there is no unrestricted fallback, the driver pays nothing for that dimension. A missing default is a revenue bug, not a validation error.
  3. Restrictions are checked continuously, not once at session start. The spec says restrictions describe when an element becomes active or inactive during a session. A session that starts at 05:30 under an off-peak window pays the off-peak rate until 06:00 and the default rate after it. Power and current restrictions switch in the same way as the car’s charging rate rises and falls, including when a limit set through the ChargingProfiles module lowers it.

A “Free of Charge” tariff is not an empty tariff. The spec defines it as one Tariff Element without restrictions holding one FLAT Price Component with price 0.00, and a free Connector should point at it through tariff_ids.

A complete Tariff in valid JSON

Off-peak energy at €0.30/kWh from 22:00 to 06:00, €0.55/kWh otherwise, a €0.50 start fee, and a €6.00/hour parking fee (€0.10 a minute) once charging stops. All prices exclude 21% VAT. This parses as-is:

{
  "country_code": "NL",
  "party_id": "TNM",
  "id": "AC-OFFPEAK-2026",
  "currency": "EUR",
  "type": "REGULAR",
  "tariff_alt_text": [
    {
      "language": "en",
      "text": "The parking fee starts when charging stops, even if the cable is still connected."
    }
  ],
  "min_price": { "excl_vat": 1.00, "incl_vat": 1.21 },
  "max_price": { "excl_vat": 60.00, "incl_vat": 72.60 },
  "elements": [
    {
      "price_components": [
        { "type": "ENERGY", "price": 0.30, "vat": 21.0, "step_size": 1 }
      ],
      "restrictions": { "start_time": "22:00", "end_time": "06:00" }
    },
    {
      "price_components": [
        { "type": "FLAT", "price": 0.50, "vat": 21.0, "step_size": 1 },
        { "type": "ENERGY", "price": 0.55, "vat": 21.0, "step_size": 1 },
        { "type": "PARKING_TIME", "price": 6.00, "vat": 21.0, "step_size": 60 }
      ]
    }
  ],
  "start_date_time": "2026-11-01T00:00:00Z",
  "last_updated": "2026-10-28T09:00:00Z"
}

Walk one session through it. A driver plugs in at 22:30, takes 20 kWh by 00:30, and leaves at 01:00.

DimensionElement usedQuantityCost excl. VAT
FLAT2 (only one with FLAT)10.50
ENERGY1 (window matches)20 kWh6.00
PARKING_TIME2 (only one with PARKING_TIME)30 min3.00
Total9.50

The example session drawn as a timeline: the FLAT fee of 0.50 comes from element 2, energy from 22:30 to 00:30 from element 1 at 0.30 per kWh, and parking from 00:30 to 01:00 from element 2 at 6.00 per hour, for 9.50 EUR before VAT

With 21% VAT that is 11.495, which shows the one thing the module leaves open. OCPI has no rounding parameters, and the spec says rounding follows applicable law, contracts and currency rules. Agree it with each partner in writing. The same session at 14:00 would use element 2 for energy and total 14.50 before VAT.

Two choices in the example are deliberate. step_size is 1 for energy because the spec advises 1 for anyone who wants compatibility with OCPI 3.0, which removes the field. And tariff_alt_text carries no prices: when a Tariff has both elements and tariff_alt_text, the text SHALL hold only additional information, because the eMSP may add its own fees when talking to its customer.

Endpoints: who calls what

InterfaceMethodPathPurpose
Sender (CPO)GET{tariffs_url}?date_from&date_to&offset&limitPaginated list for a full or delta sync
Receiver (eMSP)GET{tariffs_url}/{country_code}/{party_id}/{tariff_id}CPO checks what the eMSP holds
Receiver (eMSP)PUTsameCreate or replace a Tariff
Receiver (eMSP)DELETEsameRemove a Tariff that will not be used again

POST and PATCH are n/a on both interfaces. There is no partial update, so changing one price means a PUT of the full object. The country_code and party_id in the URL SHALL equal the ones in the body.

PUT /ocpi/emsp/2.2.1/tariffs/NL/TNM/AC-OFFPEAK-2026 HTTP/1.1
Host: emsp.example.com
Authorization: Token <token the eMSP issued to this CPO>
Content-Type: application/json
X-Request-ID: 6f1d2c1e-6b1e-4a7e-9a55-0f6c1b2d3e4f
X-Correlation-ID: 1b9c7a52-0d6e-4f0b-8b1e-3a2f4c5d6e7f

The body is the full Tariff above. A successful reply carries an envelope whose status_code is 1000. Always read the envelope, because a 2xxx client error code can arrive inside an HTTP 200. OCPI error responses explained covers the codes, and OCPI request examples shows the shared headers on other modules.

On the pull side, date_from is inclusive and date_to exclusive on last_updated, and paging uses the Link, X-Total-Count and X-Limit headers. An eMSP that relies only on pull should replace its whole known list with what it receives, which is how a deleted tariff disappears for a pull-only partner.

How tariffs connect to connectors, sessions and CDRs

Connector tariff_ids. A Connector can list several tariffs, but only one of each type may be active at a time. Two tariffs of the same type are allowed only if their start_date_time to end_date_time periods do not overlap. With preference-based smart charging, list one tariff per profile type so the driver sees each option.

Price changes without a race. The spec’s own pattern: give the current tariff an end_date_time, publish the replacement with a matching start_date_time, and list both IDs on the Connector. The switch then happens on time, and the old ID can be removed from Locations later. Before you DELETE a tariff, the spec recommends making sure no Connector still references it.

Mid-session changes. OCPI does not forbid changing a tariff during a session, but the spec notes that it is common not to, and that consumer law in many countries does not allow it. The driver agreed to the tariff that was valid at the start.

CDRs. The CDR lists the tariffs relevant to the session and names a tariff_id per charging period. That is what lets an eMSP recompute the cost and compare it with total_cost, which is how a rounding disagreement or a stale cache shows up before the driver sees it.

Different prices for different eMSPs. The Tariff object has no field naming an eMSP. Each OCPI connection is bilateral, so a CPO controls which Tariffs it PUTs to each partner; if partners get different prices, the tariff_ids on the Connectors each partner receives must match the tariffs that partner holds. Through a hub, check how it routes Tariffs and Locations before you count on this. A Tariff is the price the CPO charges the eMSP; what the eMSP then charges its driver is a separate commercial decision, and the economics of OCPI roaming works one DC session through both prices.

Common mistakes and what the spec says

MistakeWhat the spec saysFix
TIME or PARKING_TIME priced per minuteBoth are defined in hours€0.10/min is "price": 6.00
ENERGY step_size read as kWh, TIME as minutesMultipliers are 1 Wh and 1 second1000 = whole kWh, 60 = whole minutes
Unrestricted default element placed firstFirst matching element per dimension winsPut defaults last
No fallback for a dimensionNo match means no cost for itAdd an unrestricted element per dimension
Prices repeated in tariff_alt_textOnly additional info when elements existKeep prices in elements
Local store keyed on bare idid is unique only within the CPOKey on country_code + party_id + id
min_duration used as “idle for an hour”It counts session durationModel idle cost with PARKING_TIME
vat omitted to mean 0%Omitted means no VAT applicableSend 0.0 when the rate is zero
PATCH to update a pricePATCH is n/aPUT the whole Tariff
Free connector with empty tariff_idsPoint to a Free of Charge tariffOne FLAT 0.00 element, no restrictions

What changes in OCPI 2.3.0

OCPI 2.3.0, published in February 2025, keeps the module’s shape: the same endpoints, no PATCH, the same TariffType values and the same element-matching rule. The changes are about tax and payment, per the 2.3.0 Tariffs text:

  • tax_included is a new required field on the Tariff with values YES, NO and N/A, and price is read as including or excluding tax according to it. The spec’s examples use it for Canada and the United States, where tax rates are not typically known to the CPO in advance, so vat is left out.
  • min_price and max_price become a PriceLimit with before_taxes (required) and after_taxes (optional), replacing excl_vat and incl_vat.
  • preauthorize_amount is new: the amount a payment terminal provider should preauthorize for a card-paid session.

A 2.2.1 parser that rejects unknown fields will fail on 2.3.0 Tariffs, so negotiate the version per partner through Credentials and Versions. What is new in OCPI 2.3.0 covers the rest of the release.

The part OCPI leaves to you

The data model leaves less to interpretation than it first appears. Which element applies, when a restriction switches on and off, how step_size rounds and what “free” looks like are all written down. The spec stays silent on one thing on purpose, and that is how money is rounded. That gap is why two careful implementations can still produce totals a cent apart. Settle rounding with each partner before live pricing flows, recompute each CDR against the tariffs it lists, and treat a mismatch as a conversation about rounding before you treat it as an error. For the dimension-by-dimension arithmetic, including how step_size behaves when a session crosses from one element to another, continue with OCPI tariff dimensions in depth. To see how a priced session becomes an invoice, read from OCPP meter values to an invoice (coming soon).