curl --request GET \
--url https://api.spirii.com/v2/transactions/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.spirii.com/v2/transactions/{id}"
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/transactions/{id}', 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/transactions/{id}",
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/transactions/{id}"
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/transactions/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/v2/transactions/{id}")
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{
"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>"
]
}
}
},
"chargeBoxId": 123,
"chargingDetails": {
"consumed": 123,
"chargingStatus": "Charging",
"meterStart": 123,
"meterStop": 123,
"co2Emitted": 123,
"highestPowerDrawn": 123,
"vehicleStateOfCharge": {}
},
"company": {
"id": 123456,
"name": "Spirii"
},
"duration": {
"charging": 123,
"idle": 123,
"total": 123
},
"evseId": "FR.SPI.Z000001*1",
"id": 123456,
"isRoaming": true,
"location": {
"id": 654321,
"type": "Public road",
"name": "Boulevard Garibaldi",
"address": "14-16 Boulevard Garibaldi",
"zipCode": "12345",
"city": "Paris",
"crmId": 123,
"crmCustomerId": 123,
"isEligibleForRefund": true,
"countryCode": "FR"
},
"paymentMethod": "PaymentTerminal",
"paymentStatus": "succeeded",
"price": {
"amount": 100.5,
"amountExVat": 80.9,
"currency": "EUR",
"vatRate": 19.6,
"isDynamic": true,
"perKwh": 0.5
},
"startedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isPriority": true,
"appUserId": 123,
"endedAt": "2023-11-07T05:31:56Z",
"roamingDetails": {
"role": "EMP",
"roamingOperator": "<string>",
"roamingEvcoId": "<string>",
"roamingIdTagUid": "<string>",
"sessionStatus": "<string>",
"type": "Hubject",
"sessionPayload": {}
},
"tariff": {
"id": "79804bf6-0d6d-4e74-ae00-16c7238c4e77",
"name": "Spirii Tariff",
"type": "standard"
},
"voucher": {
"id": 123,
"groupId": 123,
"code": "<string>"
},
"voucherGroup": {
"id": 123,
"type": "<string>",
"name": "<string>",
"notes": "<string>",
"perKwh": 123,
"currency": "<string>"
}
}Get a transaction by ID
Returns a single Transaction from a given transactionId.
curl --request GET \
--url https://api.spirii.com/v2/transactions/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.spirii.com/v2/transactions/{id}"
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/transactions/{id}', 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/transactions/{id}",
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/transactions/{id}"
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/transactions/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/v2/transactions/{id}")
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{
"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>"
]
}
}
},
"chargeBoxId": 123,
"chargingDetails": {
"consumed": 123,
"chargingStatus": "Charging",
"meterStart": 123,
"meterStop": 123,
"co2Emitted": 123,
"highestPowerDrawn": 123,
"vehicleStateOfCharge": {}
},
"company": {
"id": 123456,
"name": "Spirii"
},
"duration": {
"charging": 123,
"idle": 123,
"total": 123
},
"evseId": "FR.SPI.Z000001*1",
"id": 123456,
"isRoaming": true,
"location": {
"id": 654321,
"type": "Public road",
"name": "Boulevard Garibaldi",
"address": "14-16 Boulevard Garibaldi",
"zipCode": "12345",
"city": "Paris",
"crmId": 123,
"crmCustomerId": 123,
"isEligibleForRefund": true,
"countryCode": "FR"
},
"paymentMethod": "PaymentTerminal",
"paymentStatus": "succeeded",
"price": {
"amount": 100.5,
"amountExVat": 80.9,
"currency": "EUR",
"vatRate": 19.6,
"isDynamic": true,
"perKwh": 0.5
},
"startedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isPriority": true,
"appUserId": 123,
"endedAt": "2023-11-07T05:31:56Z",
"roamingDetails": {
"role": "EMP",
"roamingOperator": "<string>",
"roamingEvcoId": "<string>",
"roamingIdTagUid": "<string>",
"sessionStatus": "<string>",
"type": "Hubject",
"sessionPayload": {}
},
"tariff": {
"id": "79804bf6-0d6d-4e74-ae00-16c7238c4e77",
"name": "Spirii Tariff",
"type": "standard"
},
"voucher": {
"id": 123,
"groupId": 123,
"code": "<string>"
},
"voucherGroup": {
"id": 123,
"type": "<string>",
"name": "<string>",
"notes": "<string>",
"perKwh": 123,
"currency": "<string>"
}
}Authorizations
Authorization: Bearer <SPIRII_API_KEY>
Path Parameters
ID of the transaction.
12345678
Response
Show child attributes
Show child attributes
ID of the ChargeBox..
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Duration of the transaction. Unit of measure is seconds. This object is not dynamic and it is only generated on when the transaction ends.
Show child attributes
Show child attributes
"FR.SPI.Z000001*1"
123456
Show child attributes
Show child attributes
PaymentTerminal, RoamingOperator, Stripe, MobilePay, Free, System, Invoice, Unknown succeeded, unknown, mobilepay, canceled, expired, n/a, paid, pending Show child attributes
Show child attributes
Flag signalling if this is a priority transaction
ID of an App User. This property can be null if the authenticated user is no registered to any app.
- Option 1
- Option 2
Show child attributes
Show child attributes
Value is null when no tariff is applied, e.g. Free transaction.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?