Skip to main content
GET
/
v2
/
charge-records
Get a list of CDRs
curl --request GET \
  --url https://api.spirii.com/v2/charge-records \
  --header 'Authorization: <api-key>'
{
  "data": [
    {
      "transactionId": 123,
      "sessionId": "<string>",
      "evseId": "<string>",
      "location": {
        "id": 123,
        "name": "<string>",
        "address": "<string>",
        "zipCode": "<string>",
        "city": "<string>",
        "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
      },
      "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": {
        "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>"
}

Authorizations

Authorization
string
header
required

Authorization: Bearer <SPIRII_API_KEY>

Query Parameters

mode
enum<string>

Retrieve CDRs as CPO or EMP. Defaults to CPO. CPO records are all records on your chargers, EMP are all records performed by your Drivers.

Available options:
cpo,
emp
ongoing
enum<number>
default:0

Retrieve ongoing charging sessions as part of the response.

Available options:
0,
1
updatedAtFrom
string<date-time>

Retrieve charge records updated at or after this time.

updatedAtTo
string<date-time>

Retrieve charge records updated before this time.

sortKey
string
default:updatedAt

Field used for sorting the returned results.

sortDirection
enum<string>
default:asc

Direction of sorting.

Available options:
asc,
desc
filter
string

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.

includeChildCompanyRecords
enum<number>
default:0

Retrieve charging sessions belonging to child companies as well, as part of the response.

Available options:
0,
1
priority
enum<number>
default:0

Retrieve only priority/non-priority charging records

Available options:
0,
1
nextPageCursor
string

Pagination cursor used to traverse returned records forwards when filtering returns more than limit records. This parameter is mutually exclusive with previousPageCursor.

previousPageCursor
string

Pagination cursor used to traverse returned records backwards when filtering returns more than limit records. This parameter is mutually exclusive with nextPageCursor.

limit
integer

Number of records to return.

fields
string[]

List of CDR's properties to be returned in response.

Response

data
object[]
required

Charge records

nextPageCursor
string
previousPageCursor
string