Refund a settled test session
post/v1/sessions/{session_id}/refund
Requires an API key
Refunds the full captured amount of a completed session through its payment service. Requires payments:write.
Path parameters
- session_idstringRequired
Returns · 200
- idstringRequired
- workspace_idstringRequired
- statusenumRequiredstarting: the bill start was dispatched and no transaction matched yet. stopped: the transaction completed; settle next. operator_required: the bill could not be captured (last_error, for example bill_exceeds_hold); the charger is already released and Ivora staff settle it. Connection sessions (a target other than global): connecting, then connected, or connect_failed (target.error; the charger is restored to its default), and ended once canceled, idle or at its maximum age.One of
preparing,awaiting_payment,starting,start_failed,charging,stopping,stopped,settling,completed,canceling,canceled,operator_required,connecting,connected,connect_failed,ended - providerenumRequiredOne of
simulator,stripe - payment_modestringRequired
- chargerChargerRecordRequired
Child attributes
- idstringRequiredThe bench charger leased for this session.
- tenant_idintegerRequiredThe OCPP bench tenant, which owns the station, bill and payment.
- station_idintegerRequired
- connector_idintegerRequiredConnector resource ID on the bench station.
- evseinteger | nullRequiredThe charger's EVSE the simulated EV plugs into.
- stateobject | nullRequiredWhile leased: ocpp_status (the connector's last OCPP StatusNotification) and online.
- leaseLeaseRecordRequired
Child attributes
- statusenumRequiredreleasing: the simulated EV is being unplugged before the charger is freed.One of
active,releasing,released - idle_expires_atstring | nullRequiredWhile active: when the idle sweep ends the session unless it is read or changed before.
- expires_atstring | nullWhile active: the lease's maximum age (30 minutes by default), after which the sweep stops, settles and releases however active the session is.
- released_atstring | nullRequired
- release_reasonstring | nullRequiredsettled, canceled, idle, max_age, operator, payment_canceled or stop_timeout.
- bill_idstring | nullRequired
- payment_idstring | nullRequired
- transaction_idinteger | nullRequiredTransaction resource ID of the real OCPP transaction.
- transaction_activeboolean | nullRequired
- energy_whinteger | nullRequiredInteger Wh, derived once from the core's kWh.
- energy_kwhstring | nullRequiredDecimal kWh as the charging core stores it.
- power_winteger | nullRequired
- metered_atstring | nullRequired
- estimated_minorinteger | nullRequiredBill estimate at the tariff rate; equals total_minor once final.
- total_minorinteger | nullRequiredFinal bill, fixed at settlement.
- rate_minorstring | nullRequiredMinor units per kWh, snapshotted from the bench tariff.
- hold_minorinteger | nullRequired
- refunded_minorintegerRequiredMinimum 0
- currencystringRequired
- billing_versionstringRequired
- running_costobject | nullRequiredWhat the charger's own display shows; null when the charger cannot be read or the session holds no charger.
Child attributes
- displayedbooleanRequiredFalse until the charger shows a RunningCost or FinalCost stamped after this session's transaction started.
- statusstring | nullRunning, or Finished after FinalCost.
- coststring | nullMajor currency units as the charger stores them (it truncates to its decimals).
- cost_minorinteger | nullThe same amount in units of 10^-cost_decimals.
- cost_decimalsinteger | null
- meter_whinteger | nullThe meter reading of the cost message, in Wh (an OCPP 1.6 register).
- timestampstring | null
- messagesarray of any | null
- next_actionobject | nullRequiredStripe: the hosted checkout to complete before charging starts.
- start_operationobject | nullRequired
Child attributes
- idstringRequired
- statusstringRequired
- last_errorstring | nullRequired
- targetTargetRecordRequired
Child attributes
- idstringRequiredglobal, project_url, domain:<id> or custom_url.
- kindenumRequiredOne of
global,project_url,domain,custom_url - tenant_idinteger | nullRequiredThe project whose address was used (null for global).
- urlstring | nullRequiredThe address used, without credentials; a custom URL's identity is masked.
- hoststring | nullRequired
- resolved_ipstring | nullRequiredThe address the connection was pinned to.
- portinteger | nullRequired
- station_idinteger | nullRequiredproject_url and domain: the bench's station in the project (p<project>-ivora-bench).
- identitystring | nullRequiredThe OCPP identity used, masked for custom URLs.
- passwordstring | nullRequiredAlways masked (••••••••) when one was supplied; null otherwise.
- statusenum | nullRequiredconnecting until the charger connected at the target; failed with error; resetting while the charger is factory reset after the lease; restored once it is back on its default.One of
default,connecting,connected,failed,resetting,restored - errorstring | nullRequiredWhy the connection failed: tcp, tls, http <status> or target_timeout.
- connected_atstring | nullRequired
- warningstring | nullA custom ws:// URL: the identity and password travel unencrypted.
- created_atstringRequired
- started_atstring | nullRequired
- ended_atstring | nullRequired
POST /v1/sessions/{session_id}/refund
curl --fail-with-body -X POST "https://api.ivoracharge.com/v1/sessions/session_0123456789abcdef/refund" \
-H "Authorization: Bearer $IVORA_API_KEY"Response · 200
{
"id": "id_0123456789abcdef",
"workspace_id": "workspace_0123456789abcdef",
"status": "preparing",
"provider": "simulator",
"payment_mode": "test",
"charger": {
"id": "id_0123456789abcdef",
"tenant_id": 1042,
"station_id": 1,
"connector_id": 1,
"evse": 1,
"state": {}
},
"lease": {
"status": "active",
"idle_expires_at": "2026-09-30T17:00:00Z",
"expires_at": "2026-09-30T17:00:00Z",
"released_at": "2026-09-30T17:00:00Z",
"release_reason": "string"
},
"bill_id": "bill_0123456789abcdef",
"payment_id": "payment_0123456789abcdef",
"transaction_id": 1,
"transaction_active": false,
"energy_wh": 7500,
"energy_kwh": "string",
"power_w": 1,
"metered_at": "2026-09-30T17:00:00Z",
"estimated_minor": 1250,
"total_minor": 1250,
"rate_minor": "string",
"hold_minor": 1250,
"refunded_minor": 1250,
"currency": "USD",
"billing_version": "energy-v1",
"running_cost": {
"displayed": false,
"status": "string",
"cost": "string",
"cost_minor": 1250,
"cost_decimals": 1,
"meter_wh": 7500,
"timestamp": "string",
"messages": [
null
]
},
"next_action": {},
"start_operation": {
"id": "id_0123456789abcdef",
"status": "string"
},
"last_error": "string",
"target": {
"id": "id_0123456789abcdef",
"kind": "global",
"tenant_id": 1042,
"url": "https://app.example.com/ivora/webhooks",
"host": "string",
"resolved_ip": "string",
"port": 1,
"station_id": 1,
"identity": "string",
"password": "string",
"status": "default",
"error": "string",
"connected_at": "2026-09-30T17:00:00Z",
"warning": "string"
},
"created_at": "2026-09-30T17:00:00Z",
"started_at": "2026-09-30T17:00:00Z",
"ended_at": "2026-09-30T17:00:00Z"
}Try it is not available here yetRequests from this page are off until the production API at
https://api.ivoracharge.com is public. Use the code samples from your application server; Ivora grants production access. Keys are created in Developer tools.