Get a transaction by ID
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": {},
"currentPower": 123
},
"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.
GET
/
v2
/
transactions
/
{id}
Get a transaction by ID
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": {},
"currentPower": 123
},
"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>"
}
}Response
Was this page helpful?