curl --request GET \
--url https://api.sandbox.tesouro.com/finops/v1/payable-purchase-orders \
--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-purchase-orders"
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-purchase-orders', 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-purchase-orders",
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-purchase-orders"
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-purchase-orders")
.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-purchase-orders")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"counterpart": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"individual": {
"first_name": "Adnan",
"last_name": "Singh",
"email": "asingh@example.net",
"phone": "5553211234",
"tags": [
{
"id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
"created_at": "2022-09-07T16:35:18.484507+00:00",
"updated_at": "2022-09-07T16:35:18.484507+00:00",
"name": "Marketing",
"category": "department",
"created_by_entity_user_id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
"description": "Tag for the Marketing Department"
}
],
"title": "Mr."
},
"is_customer": true,
"is_vendor": true,
"type": "individual",
"created_automatically": false,
"created_by_entity_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_billing_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_shipping_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "123456789",
"language": "ab",
"reminders_enabled": true,
"tax_id": "<string>"
},
"counterpart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "AED",
"document_id": "<string>",
"entity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"address": {
"city": "<string>",
"line1": "<string>",
"postal_code": "<string>",
"country": "DE",
"line2": "<string>",
"state": "<string>"
},
"individual": {
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"id_number": "<string>",
"ssn_last_4": "<string>",
"title": "<string>"
},
"status": "active",
"email": "<string>",
"logo": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"file_type": "payables",
"md5": "31d1a2dd1ad3dfc39be849d70a68dac0",
"mimetype": "application/pdf",
"name": "invoice.pdf",
"region": "eu-central-1",
"size": 24381,
"url": "https://bucketname.s3.amazonaws.com/12345/67890.pdf",
"pages": [],
"previews": []
},
"phone": "<string>",
"tax_id": "<string>",
"website": "<string>"
},
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"currency": "AED",
"name": "<string>",
"price": 123,
"quantity": 123,
"tax_rate": 5000,
"unit": "<string>"
}
],
"message": "<string>",
"status": "<string>",
"valid_for_days": 2,
"counterpart_address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"counterpart_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_vat_id": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"country": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"value": "<string>"
},
"file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_url": "<string>",
"issued_at": "2023-12-25",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"next_pagination_token": "<string>",
"prev_pagination_token": "<string>"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Get purchase orders
curl --request GET \
--url https://api.sandbox.tesouro.com/finops/v1/payable-purchase-orders \
--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-purchase-orders"
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-purchase-orders', 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-purchase-orders",
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-purchase-orders"
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-purchase-orders")
.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-purchase-orders")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"counterpart": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"individual": {
"first_name": "Adnan",
"last_name": "Singh",
"email": "asingh@example.net",
"phone": "5553211234",
"tags": [
{
"id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
"created_at": "2022-09-07T16:35:18.484507+00:00",
"updated_at": "2022-09-07T16:35:18.484507+00:00",
"name": "Marketing",
"category": "department",
"created_by_entity_user_id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
"description": "Tag for the Marketing Department"
}
],
"title": "Mr."
},
"is_customer": true,
"is_vendor": true,
"type": "individual",
"created_automatically": false,
"created_by_entity_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_billing_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_shipping_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "123456789",
"language": "ab",
"reminders_enabled": true,
"tax_id": "<string>"
},
"counterpart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "AED",
"document_id": "<string>",
"entity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"address": {
"city": "<string>",
"line1": "<string>",
"postal_code": "<string>",
"country": "DE",
"line2": "<string>",
"state": "<string>"
},
"individual": {
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"id_number": "<string>",
"ssn_last_4": "<string>",
"title": "<string>"
},
"status": "active",
"email": "<string>",
"logo": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"file_type": "payables",
"md5": "31d1a2dd1ad3dfc39be849d70a68dac0",
"mimetype": "application/pdf",
"name": "invoice.pdf",
"region": "eu-central-1",
"size": 24381,
"url": "https://bucketname.s3.amazonaws.com/12345/67890.pdf",
"pages": [],
"previews": []
},
"phone": "<string>",
"tax_id": "<string>",
"website": "<string>"
},
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"currency": "AED",
"name": "<string>",
"price": 123,
"quantity": 123,
"tax_rate": 5000,
"unit": "<string>"
}
],
"message": "<string>",
"status": "<string>",
"valid_for_days": 2,
"counterpart_address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"counterpart_address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_vat_id": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"country": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"value": "<string>"
},
"file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_url": "<string>",
"issued_at": "2023-12-25",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"next_pagination_token": "<string>",
"prev_pagination_token": "<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.
created_at, updated_at draft, issued 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 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 purchase orders.
Show child attributes
Show child attributes
A token that can be sent in the pagination_token query parameter to get the next page of results, or null if there is no next page (i.e. you've reached the last page).
A token that can be sent in the pagination_token query parameter to get the previous page of results, or null if there is no previous page (i.e. you've reached the first page).
Was this page helpful?