Skip to main content
POST
Import Transactions
Records charging sessions that happened outside the OCPP flow, for example sessions captured by the Plugchoice app, a Peblar local API, or a backend you are migrating away from. Every transaction created here is flagged with imported: true and stamped with the source you supply, so imported sessions stay distinguishable from ones reported by the charger itself. The payload is always a list. Importing a single session means sending a list of one. Rows are judged individually: valid ones are created, duplicates are skipped, and anything else is reported against its position in the list. One bad row never discards the rest of the batch. Only finished sessions can be imported: stopped_at and meter_stop are required.
string
required
The UUID of the charger the sessions belong to.
string
required
Where these sessions came from, e.g. Plugchoice app or peblar local. Free text, up to 100 characters. Stamped onto every transaction in the batch.
object[]
required
The sessions to import. Between 1 and 500 items.

Duplicates

A session is treated as a duplicate when it matches one that already exists on the same connector, whether it was imported earlier or reported live by the charger. It matches when started_at is the same. Because a charger clock can drift and a source can send local time as UTC, it also matches when started_at and stopped_at are both off by the same whole number of hours (up to 14), give or take 15 minutes, and the energy agrees:
  • When both sessions have a meter_start above 0, meter_start and meter_stop must each agree within 2 Wh.
  • When either meter_start is 0, the energy (meter_stop minus meter_start) must agree within 10 Wh or 1%, whichever is larger.
A session where meter_stop equals meter_start only matches on the same started_at. Duplicates are counted in skipped rather than rejected, so re-sending a batch is safe and will not double-count energy.

Response

string
Always Import completed.
integer
How many transactions were created.
integer
How many rows were skipped as duplicates.
integer
How many rows failed validation.
object[]
One entry for every row that was not created, both failures and skipped duplicates.
object[]
The transactions that were created, in the order they were sent. Each one has the same shape as a transaction returned by List Transactions, including the generated total_kwh and the assigned id.