Delete the external voucher info of an expense report
Clears the external voucher reference from the report (externalVoucherId, externalVoucherInformation, externalVoucherNumber, externalVoucherErrorInformation), and externalVoucherId, externalVoucherNumber, externalVoucherUrl and externalVoucherErrorInformation from every expense record in it. With recipientId, and if the report has a send chain, the voucher numbers of that recipient’s step are cleared as well and a REMOVED_VOUCHER_REFERENCE change log entry is written; without it, only the report and its records are cleared. The report must belong to the organization in the path and must not be deleted.
It replaces the deprecated PUT /organizations/{organizationId}/reports/{reportId}?action=deleteExternalVoucherInfo.
It requires the adminApiExpenseReports:deleteExternalVoucher permission, which is given to the same roles as adminApiExpenseReports:updateExpenseReport. The caller must also be allowed to modify reports in the organization, so a consultant with the read-only report viewer role is denied.
curl --request DELETE \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher', 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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher"
req, _ := http.NewRequest("DELETE", 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.delete("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the organization. String in UUID without dashes (32-character hex string) if access is done via values from Findity system otherwise, id of external system can be used
The unique identifier of the expense report. String, UUID format (32-character hexadecimal). Required. UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Query Parameters
Recipient whose voucher numbers are also cleared from the report's send chain. String, UUID format (32-character hexadecimal). Optional; when omitted the send chain keeps its voucher numbers. A recipient that does not belong to the organization is answered with 400 INVALID_PARAMETER and nothing is cleared.
UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Response
The external voucher info was cleared. No response body.
curl --request DELETE \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher', 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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher"
req, _ := http.NewRequest("DELETE", 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.delete("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/{reportId}/externalvoucher")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
