curl --request GET \
--url https://api.sandbox.tesouro.com/finops/v1/receivables/export/count \
--header 'Authorization: Bearer <token>' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/receivables/export/count"
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>'
}
};
fetch('https://api.sandbox.tesouro.com/finops/v1/receivables/export/count', 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.sandbox.tesouro.com/finops/v1/receivables/export/count",
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>",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-organization-id>"
],
]);
$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.sandbox.tesouro.com/finops/v1/receivables/export/count"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
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.sandbox.tesouro.com/finops/v1/receivables/export/count")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/receivables/export/count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"record_count": 123,
"row_count": 123,
"row_limit": 123
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"error": {
"message": "<string>"
}
}Count receivables for export
Count the invoices and the file rows that POST /receivables/export would produce for the given filters.
The count accepts the same filters as GET /receivables and POST /receivables/export, and counts rows the way the export does for its row limit. It describes the invoices at the time of the call. row_count above row_limit means the export would be rejected; the count itself still returns 200. Filters too large for the export to register are rejected with the same 400 as the export.
curl --request GET \
--url https://api.sandbox.tesouro.com/finops/v1/receivables/export/count \
--header 'Authorization: Bearer <token>' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/receivables/export/count"
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>'
}
};
fetch('https://api.sandbox.tesouro.com/finops/v1/receivables/export/count', 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.sandbox.tesouro.com/finops/v1/receivables/export/count",
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>",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-organization-id>"
],
]);
$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.sandbox.tesouro.com/finops/v1/receivables/export/count"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
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.sandbox.tesouro.com/finops/v1/receivables/export/count")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/receivables/export/count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"record_count": 123,
"row_count": 123,
"row_limit": 123
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"error": {
"message": "<string>"
}
}Authorizations
Headers
Query Parameters
Return only receivables that have the specified statuses. See the applicable invoice statuses, quote statuses, and credit note statuses.
To specify multiple statuses, repeat this parameter for each value:
status__in=draft&status__in=issued
draft, issued, failed, accepted, expired, declined, recurring, partially_paid, paid, overdue, uncollectible, canceled Return only receivables created by the entity users with the specified IDs.To specify multiple user IDs, repeat this parameter for each ID:
entity_user_id__in=<user1>&entity_user_id__in=<user2>
If the request is authenticated using an entity user token, this user must have the receivable.read.allowed (rather than allowed_for_own) permission to be able to query receivables created by other users.
IDs of deleted users will still produce results here if those users had associated receivables. Valid but nonexistent user IDs do not raise errors but produce no results.
Return only receivables whose tags include at least one of the tags with the specified IDs.
For example, given receivables with the following tags:
- tagA
- tagB
- tagA, tagB
- tagC
- tagB, tagC
tag_ids__in=<tagA>&tag_ids__in=<tagB> will return receivables 1, 2, 3, and 5.
Valid but nonexistent tag IDs do not raise errors but produce no results.
Return only receivables whose tags include all of the tags with the specified IDs and optionally other tags that are not specified.
For example, given receivables with the following tags:
- tagA
- tagB
- tagA, tagB
- tagC
- tagA, tagB, tagC
tag_ids=<tagA>&tag_ids=<tagB> will return receivables 3 and 5.
Return only receivables whose line items include at least one of the product IDs with the specified IDs.
To specify multiple product IDs, repeat this parameter for each ID:
product_ids__in=<product1>&product_ids__in=<product2>
For example, given receivables with the following product IDs:
- productA
- productB
- productA, productB
- productC
- productB, productC
product_ids__in=<productA>&product_ids__in=<productB> will return receivables 1, 2, 3, and 5.Valid but nonexistent product IDs do not raise errors but produce no results.
Return only receivables whose line items include all of the product IDs with the specified IDs and optionally other products that are not specified.
To specify multiple product IDs, repeat this parameter for each ID:
product_ids=<product1>&product_ids=<product2>
For example, given receivables with the following product IDs:
- productA
- productB
- productA, productB
- productC
- productA, productB, productC
product_ids=<productA>&product_ids=<productB> will return receivables 3 and 5.
Response
Successful Response
Was this page helpful?