curl --request POST \
--url https://fees.sandbox.lerian.net/v1/estimates \
--header 'Content-Type: <content-type>' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"packageId": "0196251d-a93a-7c42-9eef-c9f463470e21",
"ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
"transaction": {
"chartOfAccountsGroupName": "pix",
"description": "Test FEE",
"route": "pix",
"pending": false,
"send": {
"asset": "BRL",
"value": "4000.00",
"source": {
"from": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "customer-brl-1",
"description": "New Transaction"
}
]
},
"distribute": {
"to": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "business-brl-5",
"description": "New Transaction"
}
]
}
}
}
}
'import requests
url = "https://fees.sandbox.lerian.net/v1/estimates"
payload = {
"packageId": "0196251d-a93a-7c42-9eef-c9f463470e21",
"ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
"transaction": {
"chartOfAccountsGroupName": "pix",
"description": "Test FEE",
"route": "pix",
"pending": False,
"send": {
"asset": "BRL",
"value": "4000.00",
"source": { "from": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "customer-brl-1",
"description": "New Transaction"
}
] },
"distribute": { "to": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "business-brl-5",
"description": "New Transaction"
}
] }
}
}
}
headers = {
"Content-Type": "<content-type>",
"X-Organization-Id": "<x-organization-id>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', 'X-Organization-Id': '<x-organization-id>'},
body: JSON.stringify({
packageId: '0196251d-a93a-7c42-9eef-c9f463470e21',
ledgerId: '019c96a0-0ac0-7de9-9f53-9cf842a2ee5a',
transaction: {
chartOfAccountsGroupName: 'pix',
description: 'Test FEE',
route: 'pix',
pending: false,
send: {
asset: 'BRL',
value: '4000.00',
source: {
from: [
{
amount: {asset: 'BRL', value: '4000.00'},
accountAlias: 'customer-brl-1',
description: 'New Transaction'
}
]
},
distribute: {
to: [
{
amount: {asset: 'BRL', value: '4000.00'},
accountAlias: 'business-brl-5',
description: 'New Transaction'
}
]
}
}
}
})
};
fetch('https://fees.sandbox.lerian.net/v1/estimates', 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://fees.sandbox.lerian.net/v1/estimates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'packageId' => '0196251d-a93a-7c42-9eef-c9f463470e21',
'ledgerId' => '019c96a0-0ac0-7de9-9f53-9cf842a2ee5a',
'transaction' => [
'chartOfAccountsGroupName' => 'pix',
'description' => 'Test FEE',
'route' => 'pix',
'pending' => false,
'send' => [
'asset' => 'BRL',
'value' => '4000.00',
'source' => [
'from' => [
[
'amount' => [
'asset' => 'BRL',
'value' => '4000.00'
],
'accountAlias' => 'customer-brl-1',
'description' => 'New Transaction'
]
]
],
'distribute' => [
'to' => [
[
'amount' => [
'asset' => 'BRL',
'value' => '4000.00'
],
'accountAlias' => 'business-brl-5',
'description' => 'New Transaction'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"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://fees.sandbox.lerian.net/v1/estimates"
payload := strings.NewReader("{\n \"packageId\": \"0196251d-a93a-7c42-9eef-c9f463470e21\",\n \"ledgerId\": \"019c96a0-0ac0-7de9-9f53-9cf842a2ee5a\",\n \"transaction\": {\n \"chartOfAccountsGroupName\": \"pix\",\n \"description\": \"Test FEE\",\n \"route\": \"pix\",\n \"pending\": false,\n \"send\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\",\n \"source\": {\n \"from\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"customer-brl-1\",\n \"description\": \"New Transaction\"\n }\n ]\n },\n \"distribute\": {\n \"to\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"business-brl-5\",\n \"description\": \"New Transaction\"\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://fees.sandbox.lerian.net/v1/estimates")
.header("Content-Type", "<content-type>")
.header("X-Organization-Id", "<x-organization-id>")
.body("{\n \"packageId\": \"0196251d-a93a-7c42-9eef-c9f463470e21\",\n \"ledgerId\": \"019c96a0-0ac0-7de9-9f53-9cf842a2ee5a\",\n \"transaction\": {\n \"chartOfAccountsGroupName\": \"pix\",\n \"description\": \"Test FEE\",\n \"route\": \"pix\",\n \"pending\": false,\n \"send\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\",\n \"source\": {\n \"from\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"customer-brl-1\",\n \"description\": \"New Transaction\"\n }\n ]\n },\n \"distribute\": {\n \"to\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"business-brl-5\",\n \"description\": \"New Transaction\"\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fees.sandbox.lerian.net/v1/estimates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-Organization-Id"] = '<x-organization-id>'
request.body = "{\n \"packageId\": \"0196251d-a93a-7c42-9eef-c9f463470e21\",\n \"ledgerId\": \"019c96a0-0ac0-7de9-9f53-9cf842a2ee5a\",\n \"transaction\": {\n \"chartOfAccountsGroupName\": \"pix\",\n \"description\": \"Test FEE\",\n \"route\": \"pix\",\n \"pending\": false,\n \"send\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\",\n \"source\": {\n \"from\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"customer-brl-1\",\n \"description\": \"New Transaction\"\n }\n ]\n },\n \"distribute\": {\n \"to\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"business-brl-5\",\n \"description\": \"New Transaction\"\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Successfully estimated fee.",
"feesApplied": {
"segmentId": "019c96a0-0b4e-7079-8be0-ab6bdccf975f",
"ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
"transaction": {
"route": "019c96a0-10a0-72d2-9fb0-2b7de8093182",
"description": "Fee Example",
"pending": false,
"metadata": {
"packageAppliedID": "01962565-8d57-737b-abfa-84c3a15eeb15"
},
"send": {
"asset": "BRL",
"value": "4175.00",
"source": {
"from": [
{
"accountAlias": "customer-brl-1",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "customer-brl-2",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "customer-brl-3",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "customer-brl-4",
"amount": {
"asset": "BRL",
"value": "1175.00"
},
"route": "pixdebit",
"metadata": null
}
]
},
"distribute": {
"to": [
{
"accountAlias": "business-brl-1",
"amount": {
"asset": "BRL",
"value": "4175.00"
},
"route": "pixcredit",
"metadata": null
}
]
}
}
}
}
}Estimar Taxas de Transação
Use este endpoint para estimar as taxas de uma transação. Ajuda a validar as cobranças esperadas antes do processamento.
curl --request POST \
--url https://fees.sandbox.lerian.net/v1/estimates \
--header 'Content-Type: <content-type>' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"packageId": "0196251d-a93a-7c42-9eef-c9f463470e21",
"ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
"transaction": {
"chartOfAccountsGroupName": "pix",
"description": "Test FEE",
"route": "pix",
"pending": false,
"send": {
"asset": "BRL",
"value": "4000.00",
"source": {
"from": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "customer-brl-1",
"description": "New Transaction"
}
]
},
"distribute": {
"to": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "business-brl-5",
"description": "New Transaction"
}
]
}
}
}
}
'import requests
url = "https://fees.sandbox.lerian.net/v1/estimates"
payload = {
"packageId": "0196251d-a93a-7c42-9eef-c9f463470e21",
"ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
"transaction": {
"chartOfAccountsGroupName": "pix",
"description": "Test FEE",
"route": "pix",
"pending": False,
"send": {
"asset": "BRL",
"value": "4000.00",
"source": { "from": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "customer-brl-1",
"description": "New Transaction"
}
] },
"distribute": { "to": [
{
"amount": {
"asset": "BRL",
"value": "4000.00"
},
"accountAlias": "business-brl-5",
"description": "New Transaction"
}
] }
}
}
}
headers = {
"Content-Type": "<content-type>",
"X-Organization-Id": "<x-organization-id>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', 'X-Organization-Id': '<x-organization-id>'},
body: JSON.stringify({
packageId: '0196251d-a93a-7c42-9eef-c9f463470e21',
ledgerId: '019c96a0-0ac0-7de9-9f53-9cf842a2ee5a',
transaction: {
chartOfAccountsGroupName: 'pix',
description: 'Test FEE',
route: 'pix',
pending: false,
send: {
asset: 'BRL',
value: '4000.00',
source: {
from: [
{
amount: {asset: 'BRL', value: '4000.00'},
accountAlias: 'customer-brl-1',
description: 'New Transaction'
}
]
},
distribute: {
to: [
{
amount: {asset: 'BRL', value: '4000.00'},
accountAlias: 'business-brl-5',
description: 'New Transaction'
}
]
}
}
}
})
};
fetch('https://fees.sandbox.lerian.net/v1/estimates', 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://fees.sandbox.lerian.net/v1/estimates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'packageId' => '0196251d-a93a-7c42-9eef-c9f463470e21',
'ledgerId' => '019c96a0-0ac0-7de9-9f53-9cf842a2ee5a',
'transaction' => [
'chartOfAccountsGroupName' => 'pix',
'description' => 'Test FEE',
'route' => 'pix',
'pending' => false,
'send' => [
'asset' => 'BRL',
'value' => '4000.00',
'source' => [
'from' => [
[
'amount' => [
'asset' => 'BRL',
'value' => '4000.00'
],
'accountAlias' => 'customer-brl-1',
'description' => 'New Transaction'
]
]
],
'distribute' => [
'to' => [
[
'amount' => [
'asset' => 'BRL',
'value' => '4000.00'
],
'accountAlias' => 'business-brl-5',
'description' => 'New Transaction'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"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://fees.sandbox.lerian.net/v1/estimates"
payload := strings.NewReader("{\n \"packageId\": \"0196251d-a93a-7c42-9eef-c9f463470e21\",\n \"ledgerId\": \"019c96a0-0ac0-7de9-9f53-9cf842a2ee5a\",\n \"transaction\": {\n \"chartOfAccountsGroupName\": \"pix\",\n \"description\": \"Test FEE\",\n \"route\": \"pix\",\n \"pending\": false,\n \"send\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\",\n \"source\": {\n \"from\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"customer-brl-1\",\n \"description\": \"New Transaction\"\n }\n ]\n },\n \"distribute\": {\n \"to\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"business-brl-5\",\n \"description\": \"New Transaction\"\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://fees.sandbox.lerian.net/v1/estimates")
.header("Content-Type", "<content-type>")
.header("X-Organization-Id", "<x-organization-id>")
.body("{\n \"packageId\": \"0196251d-a93a-7c42-9eef-c9f463470e21\",\n \"ledgerId\": \"019c96a0-0ac0-7de9-9f53-9cf842a2ee5a\",\n \"transaction\": {\n \"chartOfAccountsGroupName\": \"pix\",\n \"description\": \"Test FEE\",\n \"route\": \"pix\",\n \"pending\": false,\n \"send\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\",\n \"source\": {\n \"from\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"customer-brl-1\",\n \"description\": \"New Transaction\"\n }\n ]\n },\n \"distribute\": {\n \"to\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"business-brl-5\",\n \"description\": \"New Transaction\"\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fees.sandbox.lerian.net/v1/estimates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-Organization-Id"] = '<x-organization-id>'
request.body = "{\n \"packageId\": \"0196251d-a93a-7c42-9eef-c9f463470e21\",\n \"ledgerId\": \"019c96a0-0ac0-7de9-9f53-9cf842a2ee5a\",\n \"transaction\": {\n \"chartOfAccountsGroupName\": \"pix\",\n \"description\": \"Test FEE\",\n \"route\": \"pix\",\n \"pending\": false,\n \"send\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\",\n \"source\": {\n \"from\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"customer-brl-1\",\n \"description\": \"New Transaction\"\n }\n ]\n },\n \"distribute\": {\n \"to\": [\n {\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"4000.00\"\n },\n \"accountAlias\": \"business-brl-5\",\n \"description\": \"New Transaction\"\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Successfully estimated fee.",
"feesApplied": {
"segmentId": "019c96a0-0b4e-7079-8be0-ab6bdccf975f",
"ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
"transaction": {
"route": "019c96a0-10a0-72d2-9fb0-2b7de8093182",
"description": "Fee Example",
"pending": false,
"metadata": {
"packageAppliedID": "01962565-8d57-737b-abfa-84c3a15eeb15"
},
"send": {
"asset": "BRL",
"value": "4175.00",
"source": {
"from": [
{
"accountAlias": "customer-brl-1",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "customer-brl-2",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "customer-brl-3",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "customer-brl-4",
"amount": {
"asset": "BRL",
"value": "1175.00"
},
"route": "pixdebit",
"metadata": null
}
]
},
"distribute": {
"to": [
{
"accountAlias": "business-brl-1",
"amount": {
"asset": "BRL",
"value": "4175.00"
},
"route": "pixcredit",
"metadata": null
}
]
}
}
}
}
}Cabeçalhos
O token de autorização no formato 'Bearer '.
Importante: Este header é obrigatório se o seu ambiente possui o Access Manager habilitado. Para mais informações, consulte a documentação do Access Manager.
O tipo de mídia do recurso. Deve ser application/json.
"application/json"
O identificador único da Organização associada à requisição.
"019c96a0-0a98-7287-9a31-786e0809c769"
Corpo
Resposta
Indica que o recurso foi criado com sucesso e a operação foi concluída conforme esperado.
Resultado da estimativa de taxas. message é sempre retornado com o resultado da avaliação.
feesApplied é null quando nenhuma regra de taxa ou de gratuidade corresponde à requisição (por exemplo, em casos de gratuidade ou quando nenhuma regra se aplica); caso contrário, contém a transação estimada enriquecida com as taxas.
Esta página foi útil?

