Get a session's payment
curl --request GET \
--url https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId}', 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.lynkwell.com/payments/v1/session-payments/session/{sessionId}",
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: Bearer <token>"
],
]);
$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.lynkwell.com/payments/v1/session-payments/session/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.lynkwell.com/payments/v1/session-payments/session/{sessionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "pmt_I4FkDaG7zlcoJvXJDsSsw",
"network": "<string>",
"session": "<string>",
"sitePartners": [
"<string>"
],
"location": "<string>",
"currency": "USD",
"status": "PENDING",
"paymentType": "GUEST",
"costs": {
"energy": 1828,
"idle": 108,
"flat": 108,
"time": 216
},
"usages": {
"energy": 40000,
"time": 5400,
"idle": 600
},
"taxConfig": {
"totalPercentSalesTax": 0.08,
"energyPerKwhExciseTax": 0.025
},
"preTaxChargingSessionCost": 2000,
"preTaxCosts": {
"energy": 1600,
"idle": 100,
"flat": 100,
"time": 200
},
"priceAdjustment": {
"id": "<string>",
"amount": 20,
"maxAdjustment": 400,
"calculatedAdjustment": 400
},
"taxes": {
"totalPercentSalesTax": 147,
"energyPerKwhExciseTax": 100
},
"totalTaxAmount": 247,
"billedAmount": 2078,
"recordedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"additionalFee": 250,
"preTaxAdditionalFee": 231,
"collectedAt": "2023-11-07T05:31:56Z"
}{
"message": "Unauthorized"
}{
"code": "FORBIDDEN",
"message": "<string>",
"status": 403
}{
"code": "NOT_FOUND",
"message": "<string>",
"status": 404
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "<string>",
"status": 500
}Session Payments
Get a session's payment
Returns the payment recorded for a charging session. A token scoped to a network only sees that network’s payments.
GET
/
payments
/
v1
/
session-payments
/
session
/
{sessionId}
Get a session's payment
curl --request GET \
--url https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId}', 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.lynkwell.com/payments/v1/session-payments/session/{sessionId}",
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: Bearer <token>"
],
]);
$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.lynkwell.com/payments/v1/session-payments/session/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.lynkwell.com/payments/v1/session-payments/session/{sessionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lynkwell.com/payments/v1/session-payments/session/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "pmt_I4FkDaG7zlcoJvXJDsSsw",
"network": "<string>",
"session": "<string>",
"sitePartners": [
"<string>"
],
"location": "<string>",
"currency": "USD",
"status": "PENDING",
"paymentType": "GUEST",
"costs": {
"energy": 1828,
"idle": 108,
"flat": 108,
"time": 216
},
"usages": {
"energy": 40000,
"time": 5400,
"idle": 600
},
"taxConfig": {
"totalPercentSalesTax": 0.08,
"energyPerKwhExciseTax": 0.025
},
"preTaxChargingSessionCost": 2000,
"preTaxCosts": {
"energy": 1600,
"idle": 100,
"flat": 100,
"time": 200
},
"priceAdjustment": {
"id": "<string>",
"amount": 20,
"maxAdjustment": 400,
"calculatedAdjustment": 400
},
"taxes": {
"totalPercentSalesTax": 147,
"energyPerKwhExciseTax": 100
},
"totalTaxAmount": 247,
"billedAmount": 2078,
"recordedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"additionalFee": 250,
"preTaxAdditionalFee": 231,
"collectedAt": "2023-11-07T05:31:56Z"
}{
"message": "Unauthorized"
}{
"code": "FORBIDDEN",
"message": "<string>",
"status": 403
}{
"code": "NOT_FOUND",
"message": "<string>",
"status": 404
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "<string>",
"status": 500
}Scopes
Response
The session's payment.
The payment for one charging session. All amounts are integers in the minor unit of currency (cents for USD). billedAmount = preTaxChargingSessionCost + preTaxAdditionalFee − priceAdjustment.calculatedAdjustment + totalTaxAmount.
How the session was paid for. GUEST: a guest checkout without a driver account. PAYMENT_TERMINAL: a card reader at the station. ROAMING: a roaming partner's driver. DRIVER_ACCOUNT: a driver's account, through the app, an RFID card or a vehicle. FREE: the session cost nothing and had no known payer. UNKNOWN: the session had a cost but no known payer.
Available options:
GUEST, PAYMENT_TERMINAL, ROAMING, FREE, UNKNOWN, DRIVER_ACCOUNT