Drivers
Approve payables onto a driver's draft statement
Beta: Adds the payables to the draft statement for the pay period, creating the draft if the period has none.
POST
/
api
/
p
/
v
{version}
/
driver-settlements
/
drivers
/
{driverId}
/
approve
Approve payables onto a driver's draft statement
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"PayPeriodId": "<string>",
"Payables": [
{
"PayableId": "<string>",
"PayableType": "<string>",
"LineItemIds": [
"<string>"
]
}
],
"TruckId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
PayPeriodId: '<string>',
Payables: [{PayableId: '<string>', PayableType: '<string>', LineItemIds: ['<string>']}],
TruckId: '<string>'
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve"
payload = {
"PayPeriodId": "<string>",
"Payables": [
{
"PayableId": "<string>",
"PayableType": "<string>",
"LineItemIds": ["<string>"]
}
],
"TruckId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'PayPeriodId' => '<string>',
'Payables' => [
[
'PayableId' => '<string>',
'PayableType' => '<string>',
'LineItemIds' => [
'<string>'
]
]
],
'TruckId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve"
payload := strings.NewReader("{\n \"PayPeriodId\": \"<string>\",\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"PayableType\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ],\n \"TruckId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"PayPeriodId\": \"<string>\",\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"PayableType\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ],\n \"TruckId\": \"<string>\"\n}")
.asString();{
"NumberOfLineItemsAdded": 123,
"StatementId": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Path Parameters
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
⌘I
Approve payables onto a driver's draft statement
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"PayPeriodId": "<string>",
"Payables": [
{
"PayableId": "<string>",
"PayableType": "<string>",
"LineItemIds": [
"<string>"
]
}
],
"TruckId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
PayPeriodId: '<string>',
Payables: [{PayableId: '<string>', PayableType: '<string>', LineItemIds: ['<string>']}],
TruckId: '<string>'
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve"
payload = {
"PayPeriodId": "<string>",
"Payables": [
{
"PayableId": "<string>",
"PayableType": "<string>",
"LineItemIds": ["<string>"]
}
],
"TruckId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'PayPeriodId' => '<string>',
'Payables' => [
[
'PayableId' => '<string>',
'PayableType' => '<string>',
'LineItemIds' => [
'<string>'
]
]
],
'TruckId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve"
payload := strings.NewReader("{\n \"PayPeriodId\": \"<string>\",\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"PayableType\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ],\n \"TruckId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://integrations.alvys.com/api/p/v{version}/driver-settlements/drivers/{driverId}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"PayPeriodId\": \"<string>\",\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"PayableType\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ],\n \"TruckId\": \"<string>\"\n}")
.asString();{
"NumberOfLineItemsAdded": 123,
"StatementId": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}