{"openapi":"3.1.0","info":{"title":"OneCharge Partner API","version":"1.0.0","summary":"Read-only access to a station operator's own stations, sessions, meter data and revenue.","description":"The OneCharge Partner API lets a station operator (a OneCharge team) read the data\nproduced by its own stations. Every key belongs to one team and can only ever read\nthat team's data.\n\n**Phase 1 is read-only.** Remote commands and price configuration are not offered.\n\n- All times are ISO 8601. Responses are in UTC (`Z`); requests may use any offset,\n  for example `2026-10-01T00:00:00+07:00`.\n- Amounts are in the currency of the session (`THB`), as numbers with two decimals.\n- Energy is in kWh unless the field name says `_wh`.\n- Personal data (customer names, phone numbers, RFID tags, vehicle plates) is never\n  returned.\n","contact":{"name":"OneCharge Partner Support","email":"partner-api@onecharge.co.th"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://open-api.onecharge.co.th","description":"Production. Live keys (`ock_live_…`) read real data; test keys (`ock_test_…`) read sandbox mock data."},{"url":"http://localhost:4100","description":"Local development"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account","description":"The key in use and its limits."},{"name":"Stations","description":"Stations, chargers, connectors and live connector status."},{"name":"Sessions","description":"Charging sessions and the meter readings taken during them."},{"name":"Revenue","description":"Money per session, for reconciliation."}],"paths":{"/v1/me":{"get":{"tags":["Account"],"operationId":"getMe","summary":"The key in use","description":"Returns the team, scopes, limits and environment of the key that made the call. Needs no scope; use it to test a new key.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Me"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/stations":{"get":{"tags":["Stations"],"operationId":"listStations","summary":"List stations","description":"All stations of the team, each with its chargers and connectors. Scope `stations:read`.","x-scope":"stations:read","parameters":[{"$ref":"#/components/parameters/Limit50"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Station"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/stations/{station_id}":{"get":{"tags":["Stations"],"operationId":"getStation","summary":"Get a station","description":"One station with its chargers and connectors. Scope `stations:read`.","x-scope":"stations:read","parameters":[{"name":"station_id","in":"path","required":true,"schema":{"type":"integer","example":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Station"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/connectors/{connector_id}/status":{"get":{"tags":["Stations"],"operationId":"getConnectorStatus","summary":"Live connector status","description":"The current status of one connector and when it last changed. Scope `stations:read`.\n\n`status` is grouped as on the Partner Web Connectors page; `reported_status` is the\nvalue the charger sent. `status` is `Offline` when the charger has sent no heartbeat\nfor 3 minutes, whatever the connector last reported.\n","x-scope":"stations:read","parameters":[{"name":"connector_id","in":"path","required":true,"schema":{"type":"integer","example":111}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ConnectorStatus"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/sessions":{"get":{"tags":["Sessions"],"operationId":"listSessions","summary":"List sessions","description":"Sessions at the team's stations that started within `from`–`to`, newest first.\nThe range may be at most 31 days. Scope `sessions:read`.\n","x-scope":"sessions:read","parameters":[{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"},{"name":"station_id","in":"query","schema":{"type":"integer"}},{"name":"charger_id","in":"query","schema":{"type":"integer"}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/SessionStatus"}},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/sessions/{session_id}":{"get":{"tags":["Sessions"],"operationId":"getSession","summary":"Get a session","description":"Scope `sessions:read`.","x-scope":"sessions:read","parameters":[{"$ref":"#/components/parameters/SessionId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Session"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/sessions/{session_id}/meter-values":{"get":{"tags":["Sessions"],"operationId":"getSessionMeterValues","summary":"Meter readings of a session","description":"The readings the charger reported during the session (as often as the charger sends them: every few seconds on most DC chargers),\noldest first, with a summary. Fields a charger does not report are `null`.\nAt most 5,000 readings are returned. Scope `meter:read`.\n","x-scope":"meter:read","parameters":[{"$ref":"#/components/parameters/SessionId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/MeterValues"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/transactions":{"get":{"tags":["Revenue"],"operationId":"listTransactions","summary":"List revenue per session","description":"Amount, VAT, OneCharge fee and net revenue of each session that started within\n`from`–`to`, newest first. The range may be at most 31 days. Scope `revenue:read`.\n","x-scope":"revenue:read","parameters":[{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"},{"name":"station_id","in":"query","schema":{"type":"integer"}},{"name":"payment_status","in":"query","schema":{"$ref":"#/components/schemas/PaymentStatus"}},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-OneCharge-Environment":{"$ref":"#/components/headers/X-OneCharge-Environment"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Quota-Limit":{"$ref":"#/components/headers/X-Quota-Limit"},"X-Quota-Remaining":{"$ref":"#/components/headers/X-Quota-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer ock_live_xxxxxxxx_…`. Keys are issued by OneCharge to one\nteam. A key is shown once when it is created; OneCharge stores only a hash of it.\n"}},"headers":{"X-Request-Id":{"description":"ID of this request. Quote it when contacting support.","schema":{"type":"string","format":"uuid"}},"X-OneCharge-Environment":{"description":"`live` for a live key, `sandbox` for a test key.","schema":{"type":"string","enum":["live","sandbox"]}},"RateLimit-Limit":{"description":"Requests allowed per minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute window resets.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Requests allowed per day (Asia/Bangkok day).","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Requests left today.","schema":{"type":"integer"}}},"parameters":{"From":{"name":"from","in":"query","required":true,"description":"Start of the range (inclusive), ISO 8601.","schema":{"type":"string","format":"date-time","example":"2026-10-01T00:00:00+07:00"}},"To":{"name":"to","in":"query","required":true,"description":"End of the range (exclusive), ISO 8601. At most 31 days after `from`.","schema":{"type":"string","format":"date-time","example":"2026-10-08T00:00:00+07:00"}},"Cursor":{"name":"cursor","in":"query","description":"`pagination.next_cursor` from the previous page.","schema":{"type":"string"}},"Limit50":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"Limit100":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},"SessionId":{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","example":441}}},"responses":{"BadRequest":{"description":"A parameter is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The range from–to may be at most 31 days","request_id":"3f0c9d1e-8a51-4c0e-9d4b-1b2c3d4e5f60"}}}}},"Unauthorized":{"description":"The key is missing, wrong, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"Invalid API key","request_id":"3f0c9d1e-8a51-4c0e-9d4b-1b2c3d4e5f60"}}}}},"Forbidden":{"description":"The key is valid but may not do this: `insufficient_scope`, `ip_not_allowed` or\n`client_suspended`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"This key lacks the scope meter:read","request_id":"3f0c9d1e-8a51-4c0e-9d4b-1b2c3d4e5f60"}}}}},"NotFound":{"description":"No such object for this team. Another team's objects also return 404.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Session not found","request_id":"3f0c9d1e-8a51-4c0e-9d4b-1b2c3d4e5f60"}}}}},"RateLimited":{"description":"`rate_limited` (per-minute limit) or `quota_exceeded` (daily quota). Wait `Retry-After` seconds.","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests","request_id":"3f0c9d1e-8a51-4c0e-9d4b-1b2c3d4e5f60"}}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","insufficient_scope","ip_not_allowed","client_suspended","not_found","rate_limited","quota_exceeded","internal_error","service_unavailable"]},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"}}}}},"Pagination":{"type":"object","required":["limit","has_more","next_cursor"],"properties":{"limit":{"type":"integer","example":100},"has_more":{"type":"boolean","example":true},"next_cursor":{"type":["string","null"],"description":"Pass as `cursor` to get the next page; `null` on the last page.","example":"eyJ0IjoiMjAyNi0xMC0wNyIsImlkIjo0NDF9"}}},"Me":{"type":"object","required":["team","key","limits","environment"],"properties":{"team":{"type":"object","properties":{"id":{"type":"integer","example":101},"name":{"type":"string","example":"EV Power Energy"}}},"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"prefix":{"type":"string","example":"ock_live_a1b2c3d4"},"label":{"type":"string","example":"EVPE data warehouse"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"expires_at":{"type":["string","null"],"format":"date-time"}}},"limits":{"type":"object","properties":{"per_minute":{"type":"integer","example":60},"per_day":{"type":"integer","example":20000}}},"environment":{"type":"string","enum":["live","sandbox"]}}},"Scope":{"type":"string","enum":["stations:read","sessions:read","meter:read","revenue:read"]},"Station":{"type":"object","required":["id","station_no","name","is_active","chargers"],"properties":{"id":{"type":"integer","example":1},"station_no":{"type":["string","null"],"example":"EVPE-NBI-01"},"name":{"type":["string","null"],"example":"EVPE Nonthaburi"},"name_th":{"type":["string","null"],"example":"อีวีพี นนทบุรี"},"address":{"type":["string","null"],"example":"Nonthaburi"},"location":{"type":["object","null"],"properties":{"latitude":{"type":"number","example":13.8621},"longitude":{"type":"number","example":100.5144}}},"is_active":{"type":"boolean","example":true},"chargers":{"type":"array","items":{"$ref":"#/components/schemas/Charger"}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Charger":{"type":"object","required":["id","online","connectors"],"properties":{"id":{"type":"integer","example":11},"charger_no":{"type":["string","null"],"example":"NBI-DC1"},"name":{"type":["string","null"],"example":"DC 120kW #1"},"charge_point_id":{"type":["string","null"],"description":"The OCPP charge point identity.","example":"EVPE-NBI-DC1"},"vendor":{"type":["string","null"],"example":"Autel"},"model":{"type":["string","null"],"example":"MaxiCharger DC"},"firmware_version":{"type":["string","null"],"example":"1.4.2"},"ocpp_version":{"type":["string","null"],"description":"`null` when not recorded for the charger.","example":"1.6"},"rated_power_kw":{"type":["number","null"],"example":120},"online":{"type":"boolean","description":"A heartbeat arrived within the last 5 minutes."},"last_heartbeat_at":{"type":["string","null"],"format":"date-time"},"connectors":{"type":"array","items":{"$ref":"#/components/schemas/Connector"}}}},"ConnectorStatusValue":{"type":"string","description":"As on the Partner Web Connectors page:\n- `Available`: free to use (also when the charger reports `SuspendedEV`/`SuspendedEVSE`)\n- `Preparing`: plugged in, about to charge\n- `Charging`: charging\n- `Finishing`: charging has stopped, cable still plugged in\n- `Reserved`: reserved\n- `Offline`: cannot be used: the charger is not connected (no heartbeat for 3 minutes), or reported `Unavailable` or `Faulted`. See `reported_status` for which.\n- `Unknown`: a value OneCharge does not recognise yet.\n","enum":["Available","Preparing","Charging","Finishing","Reserved","Offline","Unknown"]},"Connector":{"type":"object","required":["id","status"],"properties":{"id":{"type":"integer","example":111},"ocpp_connector_id":{"type":["integer","null"],"example":1},"connector_code":{"type":["string","null"],"example":"A"},"name":{"type":["string","null"],"example":"CCS2 A"},"connector_type":{"type":["string","null"],"description":"As configured for the connector, e.g. `CCS2`, `Type 2`, `DC`, `AC`.","example":"CCS2"},"rated_power_kw":{"type":["number","null"],"example":120},"max_current_a":{"type":["number","null"],"example":200},"status":{"$ref":"#/components/schemas/ConnectorStatusValue"},"reported_status":{"type":["string","null"],"description":"The OCPP status the charger last reported, e.g. `Faulted` behind a `status` of `Offline`.","example":"Available"},"status_changed_at":{"type":["string","null"],"format":"date-time"}}},"ConnectorStatus":{"type":"object","required":["connector_id","charger_id","station_id","status"],"properties":{"connector_id":{"type":"integer","example":111},"charger_id":{"type":"integer","example":11},"station_id":{"type":"integer","example":1},"status":{"$ref":"#/components/schemas/ConnectorStatusValue"},"reported_status":{"type":["string","null"],"description":"The OCPP status the charger last reported, e.g. `Faulted` behind a `status` of `Offline`.","example":"Available"},"status_changed_at":{"type":["string","null"],"format":"date-time"},"charger_online":{"type":"boolean","example":true},"charger_last_heartbeat_at":{"type":["string","null"],"format":"date-time"}}},"SessionStatus":{"type":"string","description":"As in the Partner Web transaction list:\n- `pending` (Pending): waiting for the charger; updates on its own\n- `processing` (Processing): charging, or totalling up the session\n- `stop_charge` (Stop Charge): charging stopped, the session is being closed\n- `completed` (Completed): finished\n- `failed` (Failed): charging did not succeed; not charged. See `failure_reason`.\n- `cancelled` (Cancelled): session cancelled; not charged\n","enum":["pending","processing","stop_charge","completed","failed","cancelled"]},"PaymentStatus":{"type":"string","description":"As in the Partner Web transaction list:\n- `paid` (Paid): the customer paid\n- `pending` (Pending): collecting from the customer; the station gets its revenue as usual\n- `failed` (Failed): could not collect from the customer, but the station still gets its revenue\n- `not_charged` (Not Charged): no power was delivered, or charging did not succeed, so nothing was charged\n","enum":["paid","pending","failed","not_charged"]},"FailureReason":{"type":"string","description":"Why a `failed` session failed, as shown in Partner Web:\n`PRICING_NOT_SET` connector has no price ·\n`CHARGER_OFFLINE` charger not connected ·\n`CHARGER_REJECTED` charger refused to start ·\n`CONNECTOR_NOT_READY` connector not ready (e.g. cable not plugged in) ·\n`CHARGER_DID_NOT_START` charger did not deliver power ·\n`CUSTOMER_DID_NOT_START` customer scanned the QR code but did not start ·\n`PAYMENT_FAILED` customer payment failed (charger is fine) ·\n`ID_TAG_NOT_REGISTERED` card/vehicle not registered ·\n`CONCURRENT_SESSION` card/vehicle charging elsewhere ·\n`NO_ENERGY_DATA` no charging data received from the charger ·\n`CANCELLED_BY_ADMIN` cancelled by the OneCharge team ·\n`SYSTEM_ERROR` OneCharge system error, not a charger problem ·\n`UNKNOWN` reason not known.\n","enum":["PRICING_NOT_SET","CHARGER_OFFLINE","CHARGER_REJECTED","CONNECTOR_NOT_READY","CHARGER_DID_NOT_START","CUSTOMER_DID_NOT_START","PAYMENT_FAILED","ID_TAG_NOT_REGISTERED","CONCURRENT_SESSION","NO_ENERGY_DATA","CANCELLED_BY_ADMIN","SYSTEM_ERROR","UNKNOWN"]},"Session":{"type":"object","required":["id","order_no","status"],"properties":{"id":{"type":"integer","example":441},"order_no":{"type":"string","example":"OC26100714220501101"},"station_id":{"type":["integer","null"],"example":1},"charger_id":{"type":"integer","example":11},"connector_id":{"type":["integer","null"],"example":111},"started_at":{"type":["string","null"],"format":"date-time"},"ended_at":{"type":["string","null"],"format":"date-time","description":"`null` while charging."},"duration_seconds":{"type":["integer","null"],"example":2700},"energy_kwh":{"type":["number","null"],"example":32.418},"meter_start_wh":{"type":["number","null"],"example":1000000},"meter_stop_wh":{"type":["number","null"],"example":1032418},"soc_start":{"type":["number","null"],"example":22},"soc_stop":{"type":["number","null"],"example":87},"status":{"$ref":"#/components/schemas/SessionStatus"},"status_detail":{"type":"string","description":"OneCharge's internal status, for support cases.","example":"Completed"},"failure_reason":{"oneOf":[{"$ref":"#/components/schemas/FailureReason"},{"type":"null"}],"description":"Set only when `status` is `failed`.","example":null},"trigger_type":{"type":["string","null"],"description":"How the session was started: `QR`, `AUTOCHARGE` or `RFID`.","example":"QR"},"payment_method_type":{"type":["string","null"],"description":"`WALLET` or `CREDIT_CARD`.","example":"WALLET"},"currency":{"type":["string","null"],"example":"THB"},"amount":{"type":["number","null"],"description":"Price before discount.","example":243.14},"discount_amount":{"type":["number","null"],"example":0},"amount_after_discount":{"type":["number","null"],"example":243.14},"payment_status":{"oneOf":[{"$ref":"#/components/schemas/PaymentStatus"},{"type":"null"}],"example":"paid"},"payment_status_detail":{"type":["string","null"],"description":"The payment status as stored (`Paid`, `Refunded`, `Failed`, `Cancelled`, `pending`), for support cases.","example":"Paid"},"stop_reason":{"type":["string","null"],"description":"Why the charger ended the session, as reported in OCPP StopTransaction (for example `EVDisconnected`, `Local`, `Remote`, `EmergencyStop`). `null` while charging, when the charger did not say, or in the sandbox.","example":"EVDisconnected"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"MeterValues":{"type":"object","required":["session_id","summary","readings"],"properties":{"session_id":{"type":"integer","example":441},"summary":{"type":"object","properties":{"reading_count":{"type":"integer","example":46},"first_reading_at":{"type":["string","null"],"format":"date-time"},"last_reading_at":{"type":["string","null"],"format":"date-time"},"energy_delivered_kwh":{"type":["number","null"],"example":40.5},"peak_power_kw":{"type":["number","null"],"example":49.8},"avg_power_kw":{"type":["number","null"],"example":40.1},"soc_start":{"type":["number","null"],"example":22},"soc_end":{"type":["number","null"],"example":67},"max_temperature_c":{"type":["number","null"],"example":58.2},"truncated":{"type":"boolean","description":"More than 5,000 readings existed; only the first 5,000 are returned."}}},"readings":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"energy_register_wh":{"type":"number","description":"The meter register reading.","example":1000900},"energy_delivered_kwh":{"type":"number","description":"Energy since the first reading of the session.","example":0.9},"power_kw":{"type":["number","null"],"example":43.7},"voltage_v":{"type":["number","null"],"description":"Average of the phases.","example":396.1},"current_a":{"type":["number","null"],"description":"Sum of the phases.","example":87.7},"soc_percent":{"type":["number","null"],"example":48},"temperature_c":{"type":["number","null"],"description":"Highest temperature reported.","example":38}}}}}},"Transaction":{"type":"object","required":["session_id","order_no"],"properties":{"session_id":{"type":"integer","example":441},"order_no":{"type":"string","example":"OC26100714220501101"},"station_id":{"type":["integer","null"],"example":1},"started_at":{"type":["string","null"],"format":"date-time"},"paid_at":{"type":["string","null"],"format":"date-time"},"currency":{"type":["string","null"],"example":"THB"},"gross_amount":{"type":"number","description":"Price before discount, VAT included.","example":397.6},"discount_amount":{"type":["number","null"],"example":0},"vat_amount":{"type":["number","null"],"description":"The VAT included in `gross_amount` (7/107 of it).","example":26.01},"fee":{"type":"object","description":"OneCharge's fee for the session.","properties":{"type":{"type":["string","null"],"description":"Not set in current data (`null`); `rate` is a percentage.","example":null},"rate":{"type":"number","description":"Percent of the price.","example":4},"before_vat":{"type":"number","example":15.9},"vat":{"type":"number","example":1.11},"total":{"type":"number","example":17.01}}},"withholding_tax":{"type":"object","properties":{"rate":{"type":["number","null"],"example":0},"amount":{"type":["number","null"],"example":0}}},"net_revenue":{"type":"number","description":"What the team receives for the session: price minus the fee.","example":380.59},"payment_method_type":{"type":["string","null"],"description":"`WALLET` or `CREDIT_CARD`.","example":"WALLET"},"payment_status":{"oneOf":[{"$ref":"#/components/schemas/PaymentStatus"},{"type":"null"}],"example":"paid"},"payment_status_detail":{"type":["string","null"],"description":"The payment status as stored (`Paid`, `Refunded`, `Failed`, `Cancelled`, `pending`), for support cases.","example":"Paid"},"reconcile_status":{"type":["string","null"],"description":"OneCharge internal reconciliation; `pending` until checked.","example":"pending"}}}}}}