curl --request PATCH \
--url https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"accounting_tax_rate_id": "dd13735f-ef3a-4312-8c37-835d70341375",
"description": "<string>",
"ledger_account_id": "7df884fd-8be8-4eba-b6ff-417b66efe033",
"name": "<string>",
"quantity": 1.22,
"subtotal": 1200,
"tax": 1250,
"tax_amount": 250,
"total": 1200,
"unit": "meter",
"unit_price": 1200
}
'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}"
payload = {
"accounting_tax_rate_id": "dd13735f-ef3a-4312-8c37-835d70341375",
"description": "<string>",
"ledger_account_id": "7df884fd-8be8-4eba-b6ff-417b66efe033",
"name": "<string>",
"quantity": 1.22,
"subtotal": 1200,
"tax": 1250,
"tax_amount": 250,
"total": 1200,
"unit": "meter",
"unit_price": 1200
}
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accounting_tax_rate_id: 'dd13735f-ef3a-4312-8c37-835d70341375',
description: '<string>',
ledger_account_id: '7df884fd-8be8-4eba-b6ff-417b66efe033',
name: '<string>',
quantity: 1.22,
subtotal: 1200,
tax: 1250,
tax_amount: 250,
total: 1200,
unit: 'meter',
unit_price: 1200
})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}', 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/payables/{payable_id}/line-items/{line_item_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accounting_tax_rate_id' => 'dd13735f-ef3a-4312-8c37-835d70341375',
'description' => '<string>',
'ledger_account_id' => '7df884fd-8be8-4eba-b6ff-417b66efe033',
'name' => '<string>',
'quantity' => 1.22,
'subtotal' => 1200,
'tax' => 1250,
'tax_amount' => 250,
'total' => 1200,
'unit' => 'meter',
'unit_price' => 1200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}"
payload := strings.NewReader("{\n \"accounting_tax_rate_id\": \"dd13735f-ef3a-4312-8c37-835d70341375\",\n \"description\": \"<string>\",\n \"ledger_account_id\": \"7df884fd-8be8-4eba-b6ff-417b66efe033\",\n \"name\": \"<string>\",\n \"quantity\": 1.22,\n \"subtotal\": 1200,\n \"tax\": 1250,\n \"tax_amount\": 250,\n \"total\": 1200,\n \"unit\": \"meter\",\n \"unit_price\": 1200\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_tax_rate_id\": \"dd13735f-ef3a-4312-8c37-835d70341375\",\n \"description\": \"<string>\",\n \"ledger_account_id\": \"7df884fd-8be8-4eba-b6ff-417b66efe033\",\n \"name\": \"<string>\",\n \"quantity\": 1.22,\n \"subtotal\": 1200,\n \"tax\": 1250,\n \"tax_amount\": 250,\n \"total\": 1200,\n \"unit\": \"meter\",\n \"unit_price\": 1200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounting_tax_rate_id\": \"dd13735f-ef3a-4312-8c37-835d70341375\",\n \"description\": \"<string>\",\n \"ledger_account_id\": \"7df884fd-8be8-4eba-b6ff-417b66efe033\",\n \"name\": \"<string>\",\n \"quantity\": 1.22,\n \"subtotal\": 1200,\n \"tax\": 1250,\n \"tax_amount\": 250,\n \"total\": 1200,\n \"unit\": \"meter\",\n \"unit_price\": 1200\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payable_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accounting_tax_rate_id": "dd13735f-ef3a-4312-8c37-835d70341375",
"description": "<string>",
"ledger_account_id": "7df884fd-8be8-4eba-b6ff-417b66efe033",
"name": "<string>",
"ocr_set_quantity_to_one": false,
"quantity": 1.22,
"subtotal": 1250,
"tax": 2000,
"tax_amount": 250,
"total": 1200,
"unit": "meter",
"unit_price": 1500,
"was_created_by_user_id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5"
}{
"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>"
}
]
}{
"error": {
"message": "<string>"
}
}Update payable line item
curl --request PATCH \
--url https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"accounting_tax_rate_id": "dd13735f-ef3a-4312-8c37-835d70341375",
"description": "<string>",
"ledger_account_id": "7df884fd-8be8-4eba-b6ff-417b66efe033",
"name": "<string>",
"quantity": 1.22,
"subtotal": 1200,
"tax": 1250,
"tax_amount": 250,
"total": 1200,
"unit": "meter",
"unit_price": 1200
}
'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}"
payload = {
"accounting_tax_rate_id": "dd13735f-ef3a-4312-8c37-835d70341375",
"description": "<string>",
"ledger_account_id": "7df884fd-8be8-4eba-b6ff-417b66efe033",
"name": "<string>",
"quantity": 1.22,
"subtotal": 1200,
"tax": 1250,
"tax_amount": 250,
"total": 1200,
"unit": "meter",
"unit_price": 1200
}
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accounting_tax_rate_id: 'dd13735f-ef3a-4312-8c37-835d70341375',
description: '<string>',
ledger_account_id: '7df884fd-8be8-4eba-b6ff-417b66efe033',
name: '<string>',
quantity: 1.22,
subtotal: 1200,
tax: 1250,
tax_amount: 250,
total: 1200,
unit: 'meter',
unit_price: 1200
})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}', 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/payables/{payable_id}/line-items/{line_item_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accounting_tax_rate_id' => 'dd13735f-ef3a-4312-8c37-835d70341375',
'description' => '<string>',
'ledger_account_id' => '7df884fd-8be8-4eba-b6ff-417b66efe033',
'name' => '<string>',
'quantity' => 1.22,
'subtotal' => 1200,
'tax' => 1250,
'tax_amount' => 250,
'total' => 1200,
'unit' => 'meter',
'unit_price' => 1200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}"
payload := strings.NewReader("{\n \"accounting_tax_rate_id\": \"dd13735f-ef3a-4312-8c37-835d70341375\",\n \"description\": \"<string>\",\n \"ledger_account_id\": \"7df884fd-8be8-4eba-b6ff-417b66efe033\",\n \"name\": \"<string>\",\n \"quantity\": 1.22,\n \"subtotal\": 1200,\n \"tax\": 1250,\n \"tax_amount\": 250,\n \"total\": 1200,\n \"unit\": \"meter\",\n \"unit_price\": 1200\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_tax_rate_id\": \"dd13735f-ef3a-4312-8c37-835d70341375\",\n \"description\": \"<string>\",\n \"ledger_account_id\": \"7df884fd-8be8-4eba-b6ff-417b66efe033\",\n \"name\": \"<string>\",\n \"quantity\": 1.22,\n \"subtotal\": 1200,\n \"tax\": 1250,\n \"tax_amount\": 250,\n \"total\": 1200,\n \"unit\": \"meter\",\n \"unit_price\": 1200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/payables/{payable_id}/line-items/{line_item_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounting_tax_rate_id\": \"dd13735f-ef3a-4312-8c37-835d70341375\",\n \"description\": \"<string>\",\n \"ledger_account_id\": \"7df884fd-8be8-4eba-b6ff-417b66efe033\",\n \"name\": \"<string>\",\n \"quantity\": 1.22,\n \"subtotal\": 1200,\n \"tax\": 1250,\n \"tax_amount\": 250,\n \"total\": 1200,\n \"unit\": \"meter\",\n \"unit_price\": 1200\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payable_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accounting_tax_rate_id": "dd13735f-ef3a-4312-8c37-835d70341375",
"description": "<string>",
"ledger_account_id": "7df884fd-8be8-4eba-b6ff-417b66efe033",
"name": "<string>",
"ocr_set_quantity_to_one": false,
"quantity": 1.22,
"subtotal": 1250,
"tax": 2000,
"tax_amount": 250,
"total": 1200,
"unit": "meter",
"unit_price": 1500,
"was_created_by_user_id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5"
}{
"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>"
}
]
}{
"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"
Body
ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
"dd13735f-ef3a-4312-8c37-835d70341375"
Description of the product.
ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
"7df884fd-8be8-4eba-b6ff-417b66efe033"
Name of the product.
The quantity of each of the goods, materials, or services listed in the payable.
x >= 01.22
The subtotal (excluding tax), in minor units. For example, $12.50 is represented as 1250..
1200
Tax amount in minor units. For example, $12.50 is represented as 1250.
250
The actual price of the product.
1200
The unit of the product
"meter"
The unit price of the product, in minor units. For example, $12.50 is represented as 1250.
1200
Response
Successful Response
ID of the tax rate reference used for accounting integartion. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
"dd13735f-ef3a-4312-8c37-835d70341375"
Description of the product.
ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
"7df884fd-8be8-4eba-b6ff-417b66efe033"
Name of the product.
Indicates whether the item's unit_price and quantity were adjusted by OCR.
false
The quantity of each of the goods, materials, or services listed in the payable.
1.22
The subtotal (excluding tax), in minor units.
1250
Tax rate in percent minor units. Example: 12.5% is 1250.
2000
Tax amount in minor units. For example, $12.50 is represented as 1250.
250
The actual price of the product.
1200
The unit of the product
"meter"
The unit price of the product, in minor units. For example, $12.50 is represented as 1250.
1500
ID of the user who created the tag.
"ea837e28-509b-4b6a-a600-d54b6aa0b1f5"
Was this page helpful?