Drivers
Remove payables from a draft statement
Beta: Takes the payables (or the named line items within them) back off the draft.
POST
/
api
/
p
/
v
{version}
/
driver-settlements
/
statements
/
{statementId}
/
unapprove
Remove payables from a draft statement
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/driver-settlements/statements/{statementId}/unapprove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Payables": [
{
"PayableId": "<string>",
"LineItemIds": [
"<string>"
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({Payables: [{PayableId: '<string>', LineItemIds: ['<string>']}]})
};
fetch('https://integrations.alvys.com/api/p/v{version}/driver-settlements/statements/{statementId}/unapprove', 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/statements/{statementId}/unapprove"
payload = { "Payables": [
{
"PayableId": "<string>",
"LineItemIds": ["<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/statements/{statementId}/unapprove",
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([
'Payables' => [
[
'PayableId' => '<string>',
'LineItemIds' => [
'<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/statements/{statementId}/unapprove"
payload := strings.NewReader("{\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ]\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/statements/{statementId}/unapprove")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();{
"StatementId": "<string>",
"NumberOfLineItemsRemoved": 123,
"DraftIsNowEmpty": true
}{
"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
Remove payables from a draft statement
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/driver-settlements/statements/{statementId}/unapprove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Payables": [
{
"PayableId": "<string>",
"LineItemIds": [
"<string>"
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({Payables: [{PayableId: '<string>', LineItemIds: ['<string>']}]})
};
fetch('https://integrations.alvys.com/api/p/v{version}/driver-settlements/statements/{statementId}/unapprove', 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/statements/{statementId}/unapprove"
payload = { "Payables": [
{
"PayableId": "<string>",
"LineItemIds": ["<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/statements/{statementId}/unapprove",
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([
'Payables' => [
[
'PayableId' => '<string>',
'LineItemIds' => [
'<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/statements/{statementId}/unapprove"
payload := strings.NewReader("{\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ]\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/statements/{statementId}/unapprove")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Payables\": [\n {\n \"PayableId\": \"<string>\",\n \"LineItemIds\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();{
"StatementId": "<string>",
"NumberOfLineItemsRemoved": 123,
"DraftIsNowEmpty": true
}{
"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>"
}