Generate output for expense reports
Generates the accounting or payment file for the listed expense reports and returns it as a download. The file format is decided by the integration of the recipient given in recipientId, so the same request produces an SIE file for one recipient and a payment file for another.
Every selected report is validated first. If any of them does not pass, nothing is generated and the call is rejected with 400 EXPENSE_REPORTS_FAILED_VALIDATION, whose data.expenseReportIds names the reports that failed. Pass ignoreValidation=true to generate the file anyway, which is what the Reports screen does for reports that have already been sent.
Every id in expenseReportIds must belong to the organization. If any of them does not, the whole call is rejected with 404 and no file is generated.
Nothing is persisted and the file is generated per request from reports that keep changing, so the answer carries Cache-Control: no-store and must not be reused for a later request.
curl --request GET \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output', 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/output",
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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output"
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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output")
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"<string>"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the organization. String, UUID format (32-character hexadecimal). Required. UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Query Parameters
The expense reports to generate output for, as a comma separated list
(expenseReportIds=05b8daba9ba14a49846fe77883248cf0,7c1f0a3b9d2e4f5a8b6c0d1e2f3a4b5c). The
endpoint also accepts the parameter repeated once per id, but the comma separated form is the one
this contract describes and the one generated clients will send.
Every id must belong to the organization, if any of them does not the whole call is rejected with 404 and no file is generated. Array of strings, UUID format (32-character hexadecimal), 1-100 items. Required.
1 - 100 elementsUUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$The recipient whose integration decides the format of the generated file. Must belong to the organization. String, UUID format (32-character hexadecimal). Required.
UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$The booking date written into the generated file. String, ISO 8601 date-time in the form yyyy-MM-ddTHH:mm:ssZ, where the zone is either Z or a numeric offset. A numeric offset has to be percent encoded (+0200 as %2B0200), since a raw plus sign is read as a space in a query string. A value in any other form is rejected with 400 INVALID_DATE. Optional, the integration decides what to use when it is left out.
When true the reports are put in the file without being validated first. Use it to generate output again for reports that have already been sent. When false, a report that does not pass validation rejects the whole call with 400 EXPENSE_REPORTS_FAILED_VALIDATION. Boolean. Optional, defaults to false.
Response
The generated file. Content-Type varies with the recipient's integration, for example text/plain for an SIE file or application/xml for an ISO-20022 payment file.
The response is of type file.
curl --request GET \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output', 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/output",
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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output"
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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/reports/output")
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"<string>"
