curl --request GET \
--url https://api.sandbox.tesouro.com/finops/v1/payable-credit-notes \
--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/payable-credit-notes"
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/payable-credit-notes', 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/payable-credit-notes",
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/payable-credit-notes"
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/payable-credit-notes")
.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/payable-credit-notes")
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{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2024-01-15T14:30:00Z",
"updated_at": "2024-01-15T14:30:00Z",
"entity_id": "123e4567-e89b-12d3-a456-426614174000",
"origin": "SAP",
"source_of_data": "user_specified",
"status": "submitted_for_approval",
"based_on": "123e4567-e89b-12d3-a456-426614174000",
"based_on_document_id": "INV-2287",
"counterpart": {
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"line2": "<string>",
"postal_code": "10001",
"state": "<string>"
},
"bank_account": {
"account_holder_name": "<string>",
"account_number": "123456789012",
"bic": "CHASUS33XXX",
"iban": "<string>",
"routing_number": "<string>",
"sort_code": "<string>"
},
"email": "acme@example.com",
"name": "Acme Inc.",
"phone": "5551231234",
"tax_id": "123456789",
"vat_id": {
"country": "AF",
"type": "<string>",
"value": "<string>"
}
},
"counterpart_address_id": "123e4567-e89b-12d3-a456-426614174000",
"counterpart_bank_account_id": "123e4567-e89b-12d3-a456-426614174000",
"counterpart_id": "123e4567-e89b-12d3-a456-426614174000",
"counterpart_raw": {
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"line2": "<string>",
"postal_code": "10001",
"state": "<string>"
},
"bank_account": {
"account_holder_name": "<string>",
"account_number": "123456789012",
"bic": "CHASUS33XXX",
"iban": "<string>",
"routing_number": "<string>",
"sort_code": "<string>"
},
"email": "acme@example.com",
"name": "Acme Inc.",
"phone": "5551231234",
"tax_id": "123456789",
"vat_id": {
"country": "AF",
"type": "<string>",
"value": "<string>"
}
},
"counterpart_vat_id_id": "123e4567-e89b-12d3-a456-426614174000",
"created_by_external_user_id": "ext_user_123",
"created_by_external_user_name": "John Doe",
"created_by_user_id": "123e4567-e89b-12d3-a456-426614174000",
"currency": "USD",
"currency_exchange": {
"default_currency_code": "<string>",
"rate": 123,
"total": 123
},
"description": "Credit note for returned items from invoice INV-2287",
"document_id": "CN-2287",
"file_id": "123e4567-e89b-12d3-a456-426614174000",
"file_url": "<string>",
"issued_at": "2024-01-15",
"ocr_request_id": "123e4567-e89b-12d3-a456-426614174000",
"ocr_status": "completed",
"project_id": "123e4567-e89b-12d3-a456-426614174000",
"sender": "supplier@example.com",
"subtotal": 1000,
"tags": [
{
"category": "department",
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Department A"
}
],
"tax": 20,
"tax_amount": 200,
"total_amount": 1200
}
],
"next_pagination_token": "eyJwYWdlIjoyfQ==",
"prev_pagination_token": "eyJwYWdlIjoxfQ=="
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Get credit notes
curl --request GET \
--url https://api.sandbox.tesouro.com/finops/v1/payable-credit-notes \
--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/payable-credit-notes"
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/payable-credit-notes', 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/payable-credit-notes",
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/payable-credit-notes"
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/payable-credit-notes")
.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/payable-credit-notes")
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{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2024-01-15T14:30:00Z",
"updated_at": "2024-01-15T14:30:00Z",
"entity_id": "123e4567-e89b-12d3-a456-426614174000",
"origin": "SAP",
"source_of_data": "user_specified",
"status": "submitted_for_approval",
"based_on": "123e4567-e89b-12d3-a456-426614174000",
"based_on_document_id": "INV-2287",
"counterpart": {
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"line2": "<string>",
"postal_code": "10001",
"state": "<string>"
},
"bank_account": {
"account_holder_name": "<string>",
"account_number": "123456789012",
"bic": "CHASUS33XXX",
"iban": "<string>",
"routing_number": "<string>",
"sort_code": "<string>"
},
"email": "acme@example.com",
"name": "Acme Inc.",
"phone": "5551231234",
"tax_id": "123456789",
"vat_id": {
"country": "AF",
"type": "<string>",
"value": "<string>"
}
},
"counterpart_address_id": "123e4567-e89b-12d3-a456-426614174000",
"counterpart_bank_account_id": "123e4567-e89b-12d3-a456-426614174000",
"counterpart_id": "123e4567-e89b-12d3-a456-426614174000",
"counterpart_raw": {
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"line2": "<string>",
"postal_code": "10001",
"state": "<string>"
},
"bank_account": {
"account_holder_name": "<string>",
"account_number": "123456789012",
"bic": "CHASUS33XXX",
"iban": "<string>",
"routing_number": "<string>",
"sort_code": "<string>"
},
"email": "acme@example.com",
"name": "Acme Inc.",
"phone": "5551231234",
"tax_id": "123456789",
"vat_id": {
"country": "AF",
"type": "<string>",
"value": "<string>"
}
},
"counterpart_vat_id_id": "123e4567-e89b-12d3-a456-426614174000",
"created_by_external_user_id": "ext_user_123",
"created_by_external_user_name": "John Doe",
"created_by_user_id": "123e4567-e89b-12d3-a456-426614174000",
"currency": "USD",
"currency_exchange": {
"default_currency_code": "<string>",
"rate": 123,
"total": 123
},
"description": "Credit note for returned items from invoice INV-2287",
"document_id": "CN-2287",
"file_id": "123e4567-e89b-12d3-a456-426614174000",
"file_url": "<string>",
"issued_at": "2024-01-15",
"ocr_request_id": "123e4567-e89b-12d3-a456-426614174000",
"ocr_status": "completed",
"project_id": "123e4567-e89b-12d3-a456-426614174000",
"sender": "supplier@example.com",
"subtotal": 1000,
"tags": [
{
"category": "department",
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Department A"
}
],
"tax": 20,
"tax_amount": 200,
"total_amount": 1200
}
],
"next_pagination_token": "eyJwYWdlIjoyfQ==",
"prev_pagination_token": "eyJwYWdlIjoxfQ=="
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The ID of the entity that owns the requested resource.
"9d2b4c8f-2087-4738-ba91-7359683c49a4"
Query Parameters
Sort order (ascending by default). Typically used together with the sort parameter.
asc, desc The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.
1 <= x <= 100A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If pagination_token is specified, all other query parameters are ignored and inferred from the initial query.
If not specified, the first page of results will be returned.
The field to sort the results by. Typically used together with the order parameter.
id, created_at x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0new, draft, applied, approved, rejected, canceled, submitted_for_approval new, draft, applied, approved, rejected, canceled, submitted_for_approval new, draft, applied, approved, rejected, canceled, submitted_for_approval upload AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW Response
Successful Response
A paginated list of credit notes.
Was this page helpful?