Change a session's metadata
Requires billing:write. Synchronous. Merges metadata into the session's metadata (its bill's), during or after the session: a key sent as "" or null is deleted, other keys keep their values. station_metadata and location_metadata, the snapshot taken when the session was created, never change. Nothing else changes and no charger is contacted. Replays with the same Idempotency-Key return the session as it is now. Errors: 404 session_not_found, 422 metadata_key_invalid, 422 metadata_too_many_keys, 422 metadata_value_invalid. See Errors and statuses.
Path parameters
- tenant_idintegerRequired
- session_idstringRequired
Headers
- idempotency-keystringRequired
Request body
- metadataobject | nullRequiredYour own key/value pairs (strings), such as a site host or a contract ID: at most 50 keys of 1-40 characters of A-Z, a-z, 0-9, underscore, period and hyphen, values of at most 500 characters. Never secrets or personal data. Never published to OCPI roaming partners. On create, sets the pairs; on PATCH, merges them into the stored ones: a key sent as "" or null is deleted, other keys keep their values.
Returns · 200
- idstringRequired
- tenant_idintegerRequired
- application_referencestringRequired
- processorstringRequired
- merchant_referencestringRequired
- payment_referencestringRequired
- created_bystringRequired
- created_atstringRequired
- settlement_ownerstringDefault
"external" - metadataobjectYour own key/value pairs (strings), such as a site host or a contract ID: at most 50 keys of 1-40 characters of A-Z, a-z, 0-9, underscore, period and hyphen, values of at most 500 characters. Never secrets or personal data. Never published to OCPI roaming partners. The session's bill's metadata (a session is its bill); writable with PATCH.
- station_metadataobjectThe station's metadata as it was when the bill was created, copied once and never changed afterwards, so historical attribution survives later edits. {} when it had none (or had no station).
- location_metadataobjectThe location's metadata as it was when the bill was created, copied once and never changed afterwards, so historical attribution survives later edits. {} when it had none (or had no location).
- statusenumRequiredOne of
prepared,starting,charging,stopping,awaiting_bill,completed,canceled,reconciliation_required - billBillRecordRequired
Child attributes
- warningsarray of objectSet only on the response that creates the bill: tariff_differs_from_connector when the requested tariff is not the one that applies to the connector (details: requested_tariff_id, connector_tariff_id, connector_tariff_source).
- idstringRequired
- tenant_idintegerRequired
- station_idintegerRequired
- connector_idintegerRequired
- sourcestringRequired
- tariff_idintegerRequired
- rate_minorstringRequired
- hold_minorintegerRequired
- currencystringRequiredThe bill's ISO 4217 currency, its tariff's (USD or CAD); every amount on the bill is in its minor units.
- charging_tokenstringRequired
- statusenumRequiredOne of
open,final - energy_kwhstring | nullRequired
- energy_whinteger | nullInteger Wh of the finalized usage.
- total_minorinteger | nullRequiredFinal bills: what the driver pays, in minor units, tax included when the bill has tax.
- transaction_idinteger | nullRequired
- created_atstringRequired
- finalized_atstring | nullRequired
- settlement_ownerenumOne of
managed,external· Default"managed" - billing_versionenumenergy-v1: a simple tariff, total_minor = round_half_up(kWh × rate_minor). elements-v1: a complex tariff's elements and rules, frozen when the bill was created; rate_minor is its base rate.One of
energy-v1,elements-v1· Default"energy-v1" - cost_breakdownobject | nullFinal bills finalized from 2026-10-15: the itemised lines and adjustments behind total_minor, from the same calculation as tariff quotes.
Child attributes
- tariff_idinteger | nullThe stored tariff quoted; null for a simulation.
- currencystringRequired
- pricing_versionenumRequiredenergy-v1: a simple tariff (kWh × rate, unchanged); elements-v1: elements and rules.One of
energy-v1,elements-v1 - linesarray of QuoteLineRequired
Child attributes
- typeenumRequiredOne of
ENERGY,TIME,PARKING_TIME,FLAT - elementintegerRequiredIndex of the element that priced this line.
- reservationbooleanRequiredThe line prices a reservation.
- quantitystringRequiredDecimal quantity in unit (rounded to 6 places for display).
- unitenumRequiredOne of
kWh,h,session - price_minorstringRequiredMinor units per unit (decimal string).
- exact_minorstringRequiredUnrounded amount, minor units (decimal string, 6 places).
- amount_minorintegerRequiredAmount rounded half up to integer minor units, for display. total_minor rounds the exact sum once, so line amounts may differ from it by rounding.
- subtotal_minorintegerRequiredThe elements' exact sum rounded half up, before rules.
- exact_subtotal_minorstringRequired
- adjustmentsarray of QuoteAdjustmentRequired
Child attributes
- kindenumRequiredOne of
group_discount,merchant_validation,max_session_cost - rulestringRequiredThe group discount id, the validation code, or max_session_cost_minor.
- exact_minorstringRequired
- amount_minorintegerRequiredNegative: a reduction.
- total_minorintegerRequiredInteger minor units: the exact subtotal after rules, rounded half up once, plus the location's tax lines when they apply (tax). Bills finalize with this same calculation.
- prepaidobject | nullRequired
Child attributes
- balance_minorintegerRequired
- covered_minorintegerRequired
- shortfall_minorintegerRequired
- limit_reachedbooleanRequiredThe session's total reaches the balance: stop or top up.
- tariff_alt_textarray of AltTextThe tariff's driver-facing descriptions, for receipts.
Child attributes
- languagestringRequiredISO 639-1 language code.Pattern
^[a-z]{2}$ - textstringRequiredDriver-facing description of the tariff.1–512 characters
- idle_free_secondsinteger | nullWith idle_grace_minutes: the idle seconds that were free; absent otherwise.
- activityobject | nullBills on complex tariffs only: the charging and idle time the bill was priced over. Null on quotes, simulations and simple tariffs (which price kWh only).
Child attributes
- methodenumRequiredocpp201_charging_state: the charger's OCPP 2.x chargingState. ocpp16_status: OCPP 1.6 connector statuses (Charging; SuspendedEV, SuspendedEVSE and Finishing are idle). ocpp16_status_and_power: those statuses, plus idle wherever the meter shows almost no power for a while. meter_power: the meter alone. none: not enough data; the whole transaction is charging time, as before idle detection (unless it drew less than 1 Wh: see reason no_energy).One of
ocpp201_charging_state,ocpp16_status,ocpp16_status_and_power,meter_power,none - detectedbooleanRequiredFalse: method none, and reason says why. A session with less than 1 Wh is all waiting (reason no_energy), and detected is true then, also with method none.
- reasonstring | nullWhy nothing was detected (for example no_state_or_meter_data); no_energy: a session with less than 1 Wh is all waiting, billing neither TIME nor PARKING_TIME nor energy; else null.
- charging_secondsintegerRequired
- idle_secondsintegerRequired
- waiting_secondsintegerPlugged in before the first charging: neither TIME nor PARKING_TIME.Default
0 - intervalsarray of ActivityIntervalRequiredThe transaction from start to end, oldest first.
Child attributes
- startstringRequiredUTC, ISO 8601.
- endstringRequiredUTC, ISO 8601.
- stateenumRequiredwaiting: plugged in before the first charging, priced as neither TIME nor PARKING_TIME.One of
charging,idle,waiting
- taxobject | nullWith a location's tax lines (location_id on quotes, the station's location on bills): the tax lines, net and total. Absent without tax.
Child attributes
- price_modeenumRequiredOne of
tax_exclusive,tax_inclusive - linesarray of QuoteTaxLineRequired
Child attributes
- namestringRequired
- typeenumRequiredOne of
percent,per_kwh - ratestringRequired
- compoundbooleanRequired
- excluded_componentsarray of enumRequired
- registration_numberstring | nullRequiredPrinted on receipts.
- base_minorstring | nullRequiredpercent lines: the exact amount taxed, minor units (decimal string, 6 places); null for per_kwh.
- quantity_kwhstring | nullRequiredper_kwh lines: the kWh taxed; null for percent.
- exact_minorstringRequiredUnrounded tax, minor units (decimal string, 6 places).
- amount_minorintegerRequiredThe line's tax, rounded half up once.
- net_minorintegerRequiredThe price before tax: total_minor minus tax_minor.
- tax_minorintegerRequiredThe sum of the lines' amount_minor.
- total_minorintegerRequiredWhat the driver pays, tax included; the quote's and bill's total_minor.
- limitobject | nullThe session limit set when the bill was started, with its stop and, once final, the overrun.
Child attributes
- typeenumRequiredOne of
energy,amount - energy_kwhstringRequiredThe energy cap the platform enforces, in kWh; for an amount limit, the amount converted at rate_minor.
- energy_whinteger | nullRequired
- amount_minorinteger | nullRequiredAmount limits: the limit in minor units.
- currencystring | nullRequired
- rate_minorstring | nullRequiredAmount limits: the bill's per-kWh rate (minor units) the amount was converted at, with the per-kWh tax on bills whose prices exclude tax.
- stop_reasonstring | nullRequiredlimit_reached once the platform decided to stop the session at its limit.
- stop_requested_atstring | nullRequired
- stop_energy_kwhstring | nullRequiredEnergy delivered (kWh) when the platform decided to stop.
- stop_operationobject | nullRequiredThe latest stop the platform sent; succeeded means the charger route accepted it.
Child attributes
- idstringRequired
- tenant_idintegerRequired
- statusenumRequiredOne of
dispatching,succeeded,rejected,unknown - resultobject | nullRequired
- created_atstringRequired
- updated_atstringRequired
- final_energy_kwhstring | nullRequiredFinal bills: the billed energy in kWh.
- final_amount_minorinteger | nullRequiredFinal bills: the billed total in minor units, including any fees.
- overrun_kwhstring | nullRequiredFinal bills: final energy minus the energy cap, never below 0.
- overrun_whinteger | nullRequired
- overrun_minorinteger | nullRequiredFinal bills with an amount limit: final amount minus the limit, never below 0.
- taxobject | nullBills at a location with tax lines: the configuration frozen when the bill was created. Absent without tax. usage.estimated_minor and total_minor include it; cost_breakdown.tax itemises it.
Child attributes
- location_idinteger | nullRequired
- price_modeenumRequiredtax_exclusive (the US norm): tariff prices exclude tax and the lines are added to them. tax_inclusive: tariff prices include every line, and the lines are taken out of the price the driver pays.One of
tax_exclusive,tax_inclusive - linesarray of TaxLineRecordRequiredThe lines, in the order they apply, with the registration numbers receipts print.
Child attributes
- orderintegerRequired1 for the first line applied.
- namestringRequired
- typeenumRequiredOne of
percent,per_kwh - ratestringRequiredDecimal text: a percentage, or minor units per kWh.
- compoundbooleanRequired
- excluded_componentsarray of enumRequired
- registration_numberstring | nullRequired
- return_urlstring | nullThe return_url its payment was created with, where hosted checkout returns the driver; null otherwise.
- metadataobjectYour own key/value pairs (strings), such as a site host or a contract ID: at most 50 keys of 1-40 characters of A-Z, a-z, 0-9, underscore, period and hyphen, values of at most 500 characters. Never secrets or personal data. Never published to OCPI roaming partners.
- station_metadataobjectThe station's metadata as it was when the bill was created, copied once and never changed afterwards, so historical attribution survives later edits. {} when it had none (or had no station).
- location_metadataobjectThe location's metadata as it was when the bill was created, copied once and never changed afterwards, so historical attribution survives later edits. {} when it had none (or had no location).
- usageobject | nullSingle bill reads only: live matched usage after start, a final snapshot once final.
Child attributes
- transaction_idinteger | nullRequiredTransaction resource ID of the charging core.
- activebooleanRequired
- energy_kwhstring | nullRequiredDecimal kWh string for display.
- energy_whinteger | nullRequiredInteger Wh for arithmetic.
- estimated_minorinteger | nullRequiredInteger minor units. On final bills this equals total_minor.
- started_atstring | nullRequired
- ended_atstring | nullRequired
- power_winteger | nullLatest reported charging power in watts; 0 once the transaction ended; null when the charger reports none.
- soc_percentinteger | nullLatest reported vehicle state of charge, when the charger reports it.
- metered_atstring | nullTimestamp of the meter sample behind power_w/soc_percent.
- start_operationobject | nullSingle bill reads only: the journaled start dispatch, if any.
Child attributes
- idstringRequired
- tenant_idintegerRequired
- statusenumRequiredOne of
dispatching,succeeded,rejected,unknown - resultobject | nullRequired
- created_atstringRequired
- updated_atstringRequired
- progressenum | nullSingle bill reads only, managed bills: the driver-facing step. awaiting_payment: the hold is not authorized yet (checkout open, card declined or retrying). authorized: authorized, no start dispatched (the application starts it). starting: the start is being dispatched. waiting_for_vehicle: the start reached the charger; no transaction yet (plug in). charging: a matched transaction is active. ended: the transaction ended or the bill is final. start_failed: the start was rejected or its outcome is unknown. canceled: the payment was canceled or its checkout expired before any transaction. Null for externally settled bills and lists.One of
awaiting_payment,authorized,starting,waiting_for_vehicle,charging,ended,start_failed,canceled
- usageobject | nullRequiredLive matched usage while charging; a final snapshot once completed. Null before a transaction is observed and on canceled sessions.
Child attributes
- transaction_idinteger | nullRequiredTransaction resource ID of the charging core.
- activebooleanRequired
- energy_kwhstring | nullRequiredDecimal kWh string for display.
- energy_whinteger | nullRequiredInteger Wh for arithmetic.
- estimated_minorinteger | nullRequiredInteger minor units. On final bills this equals total_minor.
- started_atstring | nullRequired
- ended_atstring | nullRequired
- power_winteger | nullLatest reported charging power in watts; 0 once the transaction ended; null when the charger reports none.
- soc_percentinteger | nullLatest reported vehicle state of charge, when the charger reports it.
- metered_atstring | nullTimestamp of the meter sample behind power_w/soc_percent.
- start_operationobject | nullRequired
Child attributes
- idstringRequired
- tenant_idintegerRequired
- statusenumRequiredOne of
dispatching,succeeded,rejected,unknown - resultobject | nullRequired
- created_atstringRequired
- updated_atstringRequired
- stop_operationobject | nullRequired
Child attributes
- idstringRequired
- tenant_idintegerRequired
- statusenumRequiredOne of
dispatching,succeeded,rejected,unknown - resultobject | nullRequired
- created_atstringRequired
- updated_atstringRequired
- settlementSettlementSummaryRequired
Child attributes
- verificationstringDefault
"application_reported" - captured_minorintegerRequired
- refunded_minorintegerRequired
- net_minorintegerRequired
- uncollected_minorinteger | nullRequired
- statusenumRequiredOne of
unreported,pending,unknown,failed,reported_unpaid,reported_partial,reported_paid,reported_refunded,reported_released
curl --fail-with-body -X PATCH "https://api.ivoracharge.com/v1/tenants/1042/charging-sessions/session_0123456789abcdef" \
-H "Authorization: Bearer $IVORA_API_KEY" \
-H "Idempotency-Key: order-2026-09-30-0001" \
-H "Content-Type: application/json" \
-d '{
"metadata": {}
}'{
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"application_reference": "string",
"processor": "string",
"merchant_reference": "string",
"payment_reference": "string",
"created_by": "string",
"created_at": "2026-09-30T17:00:00Z",
"settlement_owner": "external",
"metadata": {},
"station_metadata": {},
"location_metadata": {},
"status": "prepared",
"bill": {
"warnings": [
{}
],
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"station_id": 1,
"connector_id": 1,
"source": "csms",
"tariff_id": 42,
"rate_minor": "string",
"hold_minor": 1250,
"currency": "usd",
"charging_token": "string",
"status": "open",
"energy_kwh": "string",
"energy_wh": 7500,
"total_minor": 1250,
"transaction_id": 1,
"created_at": "2026-09-30T17:00:00Z",
"finalized_at": "2026-09-30T17:00:00Z",
"settlement_owner": "managed",
"billing_version": "energy-v1",
"cost_breakdown": {
"tariff_id": 42,
"currency": "usd",
"pricing_version": "energy-v1",
"lines": [
{
"type": "ENERGY",
"element": 1,
"reservation": false,
"quantity": "string",
"unit": "kWh",
"price_minor": "string",
"exact_minor": "string",
"amount_minor": 1250
}
],
"subtotal_minor": 1250,
"exact_subtotal_minor": "string",
"adjustments": [
{
"kind": "group_discount",
"rule": "string",
"exact_minor": "string",
"amount_minor": 1250
}
],
"total_minor": 1250,
"prepaid": {
"balance_minor": 1250,
"covered_minor": 1250,
"shortfall_minor": 1250,
"limit_reached": false
},
"tariff_alt_text": [
{
"language": "string",
"text": "string"
}
],
"idle_free_seconds": 1,
"activity": {
"method": "ocpp201_charging_state",
"detected": false,
"reason": "string",
"charging_seconds": 1,
"idle_seconds": 1,
"waiting_seconds": 0,
"intervals": [
{
"start": null,
"end": null,
"state": null
}
]
},
"tax": {
"price_mode": "tax_exclusive",
"lines": [
{
"name": null,
"type": null,
"rate": null,
"compound": null,
"excluded_components": null,
"registration_number": null,
"base_minor": null,
"quantity_kwh": null,
"exact_minor": null,
"amount_minor": null
}
],
"net_minor": 1250,
"tax_minor": 1250,
"total_minor": 1250
}
},
"limit": {
"type": "energy",
"energy_kwh": "string",
"energy_wh": 7500,
"amount_minor": 1250,
"currency": "usd",
"rate_minor": "string",
"stop_reason": "limit_reached",
"stop_requested_at": "2026-09-30T17:00:00Z",
"stop_energy_kwh": "string",
"stop_operation": {
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"status": "dispatching",
"result": {},
"created_at": "2026-09-30T17:00:00Z",
"updated_at": "2026-09-30T17:00:00Z"
},
"final_energy_kwh": "string",
"final_amount_minor": 1250,
"overrun_kwh": "string",
"overrun_wh": 7500,
"overrun_minor": 1250
},
"tax": {
"location_id": 7,
"price_mode": "tax_exclusive",
"lines": [
{
"order": 1,
"name": "bay-01",
"type": "percent",
"rate": "string",
"compound": false,
"excluded_components": [
null
],
"registration_number": "string"
}
]
},
"return_url": "https://app.example.com/return",
"metadata": {},
"station_metadata": {},
"location_metadata": {},
"usage": {
"transaction_id": 1,
"active": false,
"energy_kwh": "string",
"energy_wh": 7500,
"estimated_minor": 1250,
"started_at": "2026-09-30T17:00:00Z",
"ended_at": "2026-09-30T17:00:00Z",
"power_w": 1,
"soc_percent": 1,
"metered_at": "2026-09-30T17:00:00Z"
},
"start_operation": {
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"status": "dispatching",
"result": {},
"created_at": "2026-09-30T17:00:00Z",
"updated_at": "2026-09-30T17:00:00Z"
},
"progress": "awaiting_payment"
},
"usage": {
"transaction_id": 1,
"active": false,
"energy_kwh": "string",
"energy_wh": 7500,
"estimated_minor": 1250,
"started_at": "2026-09-30T17:00:00Z",
"ended_at": "2026-09-30T17:00:00Z",
"power_w": 1,
"soc_percent": 1,
"metered_at": "2026-09-30T17:00:00Z"
},
"start_operation": {
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"status": "dispatching",
"result": {},
"created_at": "2026-09-30T17:00:00Z",
"updated_at": "2026-09-30T17:00:00Z"
},
"stop_operation": {
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"status": "dispatching",
"result": {},
"created_at": "2026-09-30T17:00:00Z",
"updated_at": "2026-09-30T17:00:00Z"
},
"settlement": {
"verification": "application_reported",
"captured_minor": 1250,
"refunded_minor": 1250,
"net_minor": 1250,
"uncollected_minor": 1250,
"status": "unreported"
}
}Try itproduction · api.ivoracharge.com
Paste a production api key (iv_live_…). Create keys in Developer tools. The key stays in this page's memory, is sent only to https://api.ivoracharge.com and clears when you reload. Test keys are refused.
PATCH is a write: you confirm the method, path and project before it is sent, with a generated Idempotency-Key.



