Skip to main content

Get running charges

Description#

This endpoint is used to retrieve the currently running charges on your chargeboxes.

Request format#

Method: GET

Endpoint: https://api.thor.tools/latest/integration/charges/running

Querystring parameters:

NameDefault valueDescription
chargeboxnullOptional. If you want to retrieve only the charges performed on a specific chargebox, please provide here its ID.

Response format#

The response is a JSON containing the information related to the requested chargebox with the following fields:

Field nameTypeDescription
countIntegerThe number of charges retrieved.
itemsArrayThe list of charges.
items[].chargeboxStringThe chargebox id.
items[].connectorIntegerThe connector number of the charge .
items[].date_startedIntegerThe epoch in milliseconds that represents the time of the charge start.
items[].energyIntegerThe energy in Wh that was delivered to the vehicle.
items[].idIntegerThe transaction identifier.
items[].id_tagStringThe RFID used to start the charge (null if the charge was started remotely or using the API).
items[].paymentObjectThe payment information (null if the charge was free).
items[].payment.startFloatThe amount added at the start of the transaction.
items[].payment.methodMethodThe payment method used to pay for the charge.
items[].payment.amountFloatThe amount paid for the charge.
items[].payment.transactionStringThe transaction ID given by the payment provider.
items[].payment.nayaxIDStringThe transaction ID given by Nayax in their dashboard.
items[].payment.machineIDStringThe machine ID given by Nayax in their dashboard.
items[].payment.siteIDStringThe ID of the Nayax server that processed the transaction.
items[].typeChargeTypeThe type of transaction.
items[].userStringThe Thor registered user identifier who started the charge.
usersObjectThe details of the users who started the charges provided in the items element.
users[].addressStringThe user's address.
users[].cityStringThe user's city.
users[].countryStringThe user's country.
users[].emailStringThe user's e-mail address.
users[].nameStringThe user's name.
users[].tax_vatStringThe user's tax code or VAT number.
users[].zip_codeStringThe user's zip code.

A succesful response is returned with an HTTP status code 200 - OK

caution

The energy fields might be equal to 0 if the chargebox does not provide metering data related to the charges.

Example response#

{
"count": 5,
"items": [
{
"chargebox": "cb-kmn12iuhn313ui1",
"connector": 3,
"date_started": 1611051097702,
"energy": 0,
"id": 4,
"id_tag": null,
"payment": null,
"type": "remote",
"user": "53015afc-435a-4396-bf31-2c599da5c595"
},
{
"chargebox": "cb-oi12j398uiuh123",
"connector": 4,
"date_started": 1611051124654,
"energy": 0,
"id": 5,
"id_tag": null,
"payment": null,
"type": "remote",
"user": "53015afc-435a-4396-bf31-2c599da5c595"
},
{
"chargebox": "cb-oi12j398uiuh123",
"connector": 1,
"date_started": 1611053249000,
"energy": 0,
"id": 1,
"id_tag": "9871238783",
"payment": null,
"type": "local",
"user": "53015afc-435a-4396-bf31-2c599da5c595"
},
{
"chargebox": "cb-183u123oix92d32",
"connector": 1,
"date_started": 1612167051594,
"energy": 0,
"id": 628,
"id_tag": null,
"payment": {
"amount": 15.3
"method": "stripe",
"transaction": "pi_xxxxxxxxxxxxxxxxx"
},
"type": "remote",
"user": "731f9244-2768-43bd-a3c0-cbfcdbea5307"
}
],
"users": {
"731f9244-2768-43bd-a3c0-cbfcdbea5307": {
"address": "Nostrand Ave., Brooklyn",
"city": "New York",
"country": "US",
"email": "john.doe@gmail.com",
"name": "John Doe",
"tax_vat": "XXXYYY123QQABC",
"zip_code": "11225"
},
"53015afc-435a-4396-bf31-2c599da5c595": {
"address": "Allen St",
"city": "New York",
"country": "US",
"email": "jane.morris@gmail.com",
"name": "Jane Morris",
"tax_vat": "AAASSDDDD999ZXC",
"zip_code": "10002"
}
}
}

Error response#

The following errors are returned if something went wrong while processing the request:

HTTP status codeMessageDescription
403APIKeyNotFoundAn invalid API key was given in the header of the request.
403RestAPINotEnabledREST API integration is set as disabled in the administration dashboard.
403InvalidSourceIPAddrThe request comes from an IP address that is different from the one given in the REST API integration configuration.
500InternalServerErrorSomething unexpected went wrong while executing the request.

Enums#

Method#

These are the possible types of payment method:

  • "stripe" for charges started with Stripe
  • "paypal" for charges started with PayPal
  • "nayax" for charges started with Nayax
  • "free" for charges started from Thor dashboard
  • null for charges started on a chargebox with a free payment payment set from webapp
  • undefined for charges started with a RFID card

ChargeType#

These are the possible types of charge:

  • remote for charges started using the web app
  • local for charges started using an RFID card
  • api for charges started using an API request