Get a list of CDRs
curl --request GET \
--url https://api.spirii.com/v2/charge-records \
--header 'Authorization: <api-key>'import requests
url = "https://api.spirii.com/v2/charge-records"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.spirii.com/v2/charge-records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spirii.com/v2/charge-records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spirii.com/v2/charge-records"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.spirii.com/v2/charge-records")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/v2/charge-records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"transactionId": 123,
"sessionId": "<string>",
"evseId": "<string>",
"location": {
"id": 123,
"name": "<string>",
"address": "<string>",
"zipCode": "<string>",
"city": "<string>",
"type": "Public road",
"timezone": "<string>",
"isPublic": true,
"crmId": 123,
"crmCustomerId": 123,
"isEligibleForRefund": true,
"appUserId": 123,
"country": "DK"
},
"consumed": 123,
"price": {
"amountExVat": 123,
"currency": "<string>",
"vatRate": 0.25,
"amount": 123,
"perKwh": 123,
"isDynamic": true,
"spotPriceMargin": 123,
"spotPriceMinimum": 123,
"roamingTariffId": 123,
"roamingTariffProductId": "<string>",
"tariffId": 123456,
"tariffs": {},
"breakdown": {},
"tariffName": "<string>"
},
"card": {
"brand": "<string>",
"lastFour": 123,
"customerId": "<string>",
"vatId": "<string>"
},
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"duration": {
"charging": 123,
"idle": 123,
"total": 123
},
"paymentMethod": "PaymentTerminal",
"paymentStatus": "unknown",
"paymentMetadata": {
"paymentStatus": "<string>",
"maskedPan": "<string>",
"merchantId": "<string>",
"merchantInfo": {
"name": "<string>",
"address": "<string>",
"taxId": "<string>"
},
"terminalId": "<string>",
"terminalSerialNumber": "<string>",
"externalSessionId": "<string>",
"sessionId": 123,
"paidAt": "2023-11-07T05:31:56Z"
},
"auth": {
"name": "OCPI - RFID authorized",
"type": "App",
"idTag": {
"uid": "<string>",
"id": 123,
"type": "<string>",
"label": "<string>",
"customerId": 123,
"operatorId": 123,
"companyId": 123,
"familyTreeCompanyIds": [
"<string>"
],
"crmCustomerId": 123,
"comment": "<string>",
"billingReference": "<string>",
"customerCrmCustomerId": 123,
"companyCrmCustomerId": 123,
"operator": {
"id": 123,
"name": "<string>",
"crmId": 123
},
"company": {
"id": 123,
"name": "<string>"
},
"customer": {
"id": 123,
"firstName": "<string>",
"lastName": "<string>",
"operator": {
"id": 123,
"name": "<string>"
},
"company": {
"id": 123,
"name": "<string>"
},
"familyTreeCompanyIds": [
"<string>"
]
}
}
},
"isRoaming": true,
"company": {
"id": 123,
"name": "<string>"
},
"familyTreeCompanyIds": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isPriority": true,
"energyCostEstimation": {
"cost": 10.5
},
"cpoDefaultPrice": {
"currency": "<string>",
"vatRate": 0.25,
"amount": 123,
"amountExVat": 123,
"perKwh": 123,
"breakdown": {},
"tariffId": 123456,
"tariffName": "<string>",
"isDynamic": true,
"spotPriceMargin": 123,
"spotPriceMinimum": 123
},
"pricingSource": {
"currency": "<string>",
"id": "<string>",
"spi_id": "<string>",
"tariffId": 123,
"perKwh": 123,
"elements": [
{}
],
"last_updated": "2023-11-07T05:31:56Z",
"isOcpiBased": true,
"isSpotPriceBased": true,
"vat": 123
},
"voucher": {
"id": 123,
"groupId": 123,
"code": "<string>",
"currency": "<string>",
"type": "<string>",
"perKwh": 123
},
"voucherGroup": {
"id": 123,
"name": "<string>",
"notes": "<string>"
},
"user": 123,
"merchantInfo": {
"name": "<string>",
"address": "<string>",
"taxId": "<string>"
},
"roamingDetails": {
"type": "<string>",
"role": "<string>",
"roamingOperator": "<string>",
"roamingEvcoId": "<string>",
"roamingIdTagUid": "<string>",
"sessionStatus": "<string>",
"sessionPayload": {},
"billable": true,
"roamingTariffId": 123
},
"isPublicSharing": true,
"priceSource": "<string>",
"operatorName": "<string>",
"operatorId": 123,
"chargeBoxId": 123,
"chargingTime": 123,
"idleTime": 123,
"meterStart": 0,
"vehicleState": {
"firstValue": 50,
"lastValue": 50
},
"meterStop": 12.34,
"co2": 0.03,
"highestPowerDrawn": 10.692,
"maxPower": 123,
"role": "<string>",
"remotelyStoppedAt": "2023-11-07T05:31:56Z"
}
],
"nextPageCursor": "<string>",
"previousPageCursor": "<string>"
}Get a list of CDRs
GET
/
v2
/
charge-records
Get a list of CDRs
curl --request GET \
--url https://api.spirii.com/v2/charge-records \
--header 'Authorization: <api-key>'import requests
url = "https://api.spirii.com/v2/charge-records"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.spirii.com/v2/charge-records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spirii.com/v2/charge-records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spirii.com/v2/charge-records"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.spirii.com/v2/charge-records")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/v2/charge-records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"transactionId": 123,
"sessionId": "<string>",
"evseId": "<string>",
"location": {
"id": 123,
"name": "<string>",
"address": "<string>",
"zipCode": "<string>",
"city": "<string>",
"type": "Public road",
"timezone": "<string>",
"isPublic": true,
"crmId": 123,
"crmCustomerId": 123,
"isEligibleForRefund": true,
"appUserId": 123,
"country": "DK"
},
"consumed": 123,
"price": {
"amountExVat": 123,
"currency": "<string>",
"vatRate": 0.25,
"amount": 123,
"perKwh": 123,
"isDynamic": true,
"spotPriceMargin": 123,
"spotPriceMinimum": 123,
"roamingTariffId": 123,
"roamingTariffProductId": "<string>",
"tariffId": 123456,
"tariffs": {},
"breakdown": {},
"tariffName": "<string>"
},
"card": {
"brand": "<string>",
"lastFour": 123,
"customerId": "<string>",
"vatId": "<string>"
},
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"duration": {
"charging": 123,
"idle": 123,
"total": 123
},
"paymentMethod": "PaymentTerminal",
"paymentStatus": "unknown",
"paymentMetadata": {
"paymentStatus": "<string>",
"maskedPan": "<string>",
"merchantId": "<string>",
"merchantInfo": {
"name": "<string>",
"address": "<string>",
"taxId": "<string>"
},
"terminalId": "<string>",
"terminalSerialNumber": "<string>",
"externalSessionId": "<string>",
"sessionId": 123,
"paidAt": "2023-11-07T05:31:56Z"
},
"auth": {
"name": "OCPI - RFID authorized",
"type": "App",
"idTag": {
"uid": "<string>",
"id": 123,
"type": "<string>",
"label": "<string>",
"customerId": 123,
"operatorId": 123,
"companyId": 123,
"familyTreeCompanyIds": [
"<string>"
],
"crmCustomerId": 123,
"comment": "<string>",
"billingReference": "<string>",
"customerCrmCustomerId": 123,
"companyCrmCustomerId": 123,
"operator": {
"id": 123,
"name": "<string>",
"crmId": 123
},
"company": {
"id": 123,
"name": "<string>"
},
"customer": {
"id": 123,
"firstName": "<string>",
"lastName": "<string>",
"operator": {
"id": 123,
"name": "<string>"
},
"company": {
"id": 123,
"name": "<string>"
},
"familyTreeCompanyIds": [
"<string>"
]
}
}
},
"isRoaming": true,
"company": {
"id": 123,
"name": "<string>"
},
"familyTreeCompanyIds": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isPriority": true,
"energyCostEstimation": {
"cost": 10.5
},
"cpoDefaultPrice": {
"currency": "<string>",
"vatRate": 0.25,
"amount": 123,
"amountExVat": 123,
"perKwh": 123,
"breakdown": {},
"tariffId": 123456,
"tariffName": "<string>",
"isDynamic": true,
"spotPriceMargin": 123,
"spotPriceMinimum": 123
},
"pricingSource": {
"currency": "<string>",
"id": "<string>",
"spi_id": "<string>",
"tariffId": 123,
"perKwh": 123,
"elements": [
{}
],
"last_updated": "2023-11-07T05:31:56Z",
"isOcpiBased": true,
"isSpotPriceBased": true,
"vat": 123
},
"voucher": {
"id": 123,
"groupId": 123,
"code": "<string>",
"currency": "<string>",
"type": "<string>",
"perKwh": 123
},
"voucherGroup": {
"id": 123,
"name": "<string>",
"notes": "<string>"
},
"user": 123,
"merchantInfo": {
"name": "<string>",
"address": "<string>",
"taxId": "<string>"
},
"roamingDetails": {
"type": "<string>",
"role": "<string>",
"roamingOperator": "<string>",
"roamingEvcoId": "<string>",
"roamingIdTagUid": "<string>",
"sessionStatus": "<string>",
"sessionPayload": {},
"billable": true,
"roamingTariffId": 123
},
"isPublicSharing": true,
"priceSource": "<string>",
"operatorName": "<string>",
"operatorId": 123,
"chargeBoxId": 123,
"chargingTime": 123,
"idleTime": 123,
"meterStart": 0,
"vehicleState": {
"firstValue": 50,
"lastValue": 50
},
"meterStop": 12.34,
"co2": 0.03,
"highestPowerDrawn": 10.692,
"maxPower": 123,
"role": "<string>",
"remotelyStoppedAt": "2023-11-07T05:31:56Z"
}
],
"nextPageCursor": "<string>",
"previousPageCursor": "<string>"
}Query Parameters
Filter object using stringified JSON in MongoDB format. Allowed fields: operatorId, companyId, company.id, auth.idTag.id, auth.idTag.operatorId, auth.idTag.companyId, auth.idTag.customerId, auth.idTag.crmCustomerId, auth.type, transactionId, location.country, location.isPublic, location.crmCustomerId, auth.idTag.uid, startedAt, endedAt, updatedAt, createdAt, isRoaming, location.appUserId, location.id, location.type, consumed, role, evseId, sessionId, paymentMetadata.externalSessionId, roamingDetails.type, voucher.id, chargeBoxId. Mongo operators: $gt, $gte, $lt, $lte, $eq, $ne, $in, $nin, $exists, $regex. Logical operators: $or, $and.
Was this page helpful?