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
}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.
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
}Authorizations
OAuth2 Client Credentials Flow
Path Parameters
ID of the charging session.
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.
Unique ID, prefixed pmt_.
"pmt_I4FkDaG7zlcoJvXJDsSsw"
ID of the network the session belongs to.
ID of the charging session. A session has at most one payment.
IDs of the charging station's site partners when the payment was recorded.
ID of the charging station's location.
ISO 4217 currency code of the session's rate.
"USD"
PENDING: recorded, but the money has not been collected from the driver yet. COLLECTED: the money has been collected.
PENDING, COLLECTED 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.
GUEST, PAYMENT_TERMINAL, ROAMING, FREE, UNKNOWN, DRIVER_ACCOUNT The session's charges per pricing component, as the session service calculated them. Tax-inclusive, before any discount.
Show child attributes
Show child attributes
{
"energy": 1828,
"idle": 108,
"flat": 108,
"time": 216
}
What the session used.
Show child attributes
Show child attributes
The location's tax rates when the payment was recorded. null when the location has no tax configured.
Show child attributes
Show child attributes
Pre-tax cost of the charging session before any discount, excluding additionalFee.
2000
Pre-tax value of each component of costs. They normally sum to preTaxChargingSessionCost.
Show child attributes
Show child attributes
{
"energy": 1600,
"idle": 100,
"flat": 100,
"time": 200
}
The driver discount applied to the session, as it stood when the payment was recorded. null when no discount applied.
Show child attributes
Show child attributes
Tax included in billedAmount, by kind. These are amounts, not rates.
Show child attributes
Show child attributes
Sum of taxes.
247
Total charged to the driver: tax-inclusive, after any discount, including additionalFee.
2078
When the payment was recorded.
Fee charged on top of the session, tax-inclusive. Omitted when no fee was charged.
250
Pre-tax share of additionalFee. Its sales tax is part of taxes.totalPercentSalesTax. Omitted when there is no additionalFee.
231
When the payment was collected. Not set while status is PENDING.