Create boleto
curl --request POST \
--url https://api.sandbox.trio.com.br/banking/cashin/boletos \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 402,
"counterparty": {
"address": "Rua sem nome, 100",
"city": "Curitiba",
"district": "Centro",
"name": "NOME DO PARTICIPANTE",
"postal_code": "83706160",
"state": "PR",
"tax_number": "05964110000197"
},
"description": "Pago a trio.com.br",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{
"amount": 10,
"date": "2025-12-13"
},
{
"amount": 9,
"date": "2025-12-14"
},
{
"amount": 8,
"date": "2025-12-15"
}
],
"calculation_type": "amount | percentage"
},
"per_day_antecipated": {
"amount": 10,
"calculation_days": "working | calendar",
"calculation_type": "amount | percentage"
}
},
"due_date": "2025-12-16",
"fine": {
"amount": 10,
"calculation_type": "amount | percentage"
},
"interest": {
"amount": 10,
"calculation_type": "daily_rate | monthly_fee | exempt | bank_control"
}
},
"expiration_date": "2025-12-10",
"external_id": "external id 123",
"invoice_type": "invoice",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"wallet_type": "book_entry_electronic_bloquete"
}
'import requests
url = "https://api.sandbox.trio.com.br/banking/cashin/boletos"
payload = {
"amount": 402,
"counterparty": {
"address": "Rua sem nome, 100",
"city": "Curitiba",
"district": "Centro",
"name": "NOME DO PARTICIPANTE",
"postal_code": "83706160",
"state": "PR",
"tax_number": "05964110000197"
},
"description": "Pago a trio.com.br",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{
"amount": 10,
"date": "2025-12-13"
},
{
"amount": 9,
"date": "2025-12-14"
},
{
"amount": 8,
"date": "2025-12-15"
}
],
"calculation_type": "amount | percentage"
},
"per_day_antecipated": {
"amount": 10,
"calculation_days": "working | calendar",
"calculation_type": "amount | percentage"
}
},
"due_date": "2025-12-16",
"fine": {
"amount": 10,
"calculation_type": "amount | percentage"
},
"interest": {
"amount": 10,
"calculation_type": "daily_rate | monthly_fee | exempt | bank_control"
}
},
"expiration_date": "2025-12-10",
"external_id": "external id 123",
"invoice_type": "invoice",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"wallet_type": "book_entry_electronic_bloquete"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 402,
counterparty: {
address: 'Rua sem nome, 100',
city: 'Curitiba',
district: 'Centro',
name: 'NOME DO PARTICIPANTE',
postal_code: '83706160',
state: 'PR',
tax_number: '05964110000197'
},
description: 'Pago a trio.com.br',
due_detail: {
discount: {
fixed_until_due: {
amounts: [
{amount: 10, date: '2025-12-13'},
{amount: 9, date: '2025-12-14'},
{amount: 8, date: '2025-12-15'}
],
calculation_type: 'amount | percentage'
},
per_day_antecipated: {
amount: 10,
calculation_days: 'working | calendar',
calculation_type: 'amount | percentage'
}
},
due_date: '2025-12-16',
fine: {amount: 10, calculation_type: 'amount | percentage'},
interest: {
amount: 10,
calculation_type: 'daily_rate | monthly_fee | exempt | bank_control'
}
},
expiration_date: '2025-12-10',
external_id: 'external id 123',
invoice_type: 'invoice',
virtual_account_id: '0196f83d-cafa-f412-1f1d-129cdf2dda49',
wallet_type: 'book_entry_electronic_bloquete'
})
};
fetch('https://api.sandbox.trio.com.br/banking/cashin/boletos', 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.trio.com.br/banking/cashin/boletos",
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([
'amount' => 402,
'counterparty' => [
'address' => 'Rua sem nome, 100',
'city' => 'Curitiba',
'district' => 'Centro',
'name' => 'NOME DO PARTICIPANTE',
'postal_code' => '83706160',
'state' => 'PR',
'tax_number' => '05964110000197'
],
'description' => 'Pago a trio.com.br',
'due_detail' => [
'discount' => [
'fixed_until_due' => [
'amounts' => [
[
'amount' => 10,
'date' => '2025-12-13'
],
[
'amount' => 9,
'date' => '2025-12-14'
],
[
'amount' => 8,
'date' => '2025-12-15'
]
],
'calculation_type' => 'amount | percentage'
],
'per_day_antecipated' => [
'amount' => 10,
'calculation_days' => 'working | calendar',
'calculation_type' => 'amount | percentage'
]
],
'due_date' => '2025-12-16',
'fine' => [
'amount' => 10,
'calculation_type' => 'amount | percentage'
],
'interest' => [
'amount' => 10,
'calculation_type' => 'daily_rate | monthly_fee | exempt | bank_control'
]
],
'expiration_date' => '2025-12-10',
'external_id' => 'external id 123',
'invoice_type' => 'invoice',
'virtual_account_id' => '0196f83d-cafa-f412-1f1d-129cdf2dda49',
'wallet_type' => 'book_entry_electronic_bloquete'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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.trio.com.br/banking/cashin/boletos"
payload := strings.NewReader("{\n \"amount\": 402,\n \"counterparty\": {\n \"address\": \"Rua sem nome, 100\",\n \"city\": \"Curitiba\",\n \"district\": \"Centro\",\n \"name\": \"NOME DO PARTICIPANTE\",\n \"postal_code\": \"83706160\",\n \"state\": \"PR\",\n \"tax_number\": \"05964110000197\"\n },\n \"description\": \"Pago a trio.com.br\",\n \"due_detail\": {\n \"discount\": {\n \"fixed_until_due\": {\n \"amounts\": [\n {\n \"amount\": 10,\n \"date\": \"2025-12-13\"\n },\n {\n \"amount\": 9,\n \"date\": \"2025-12-14\"\n },\n {\n \"amount\": 8,\n \"date\": \"2025-12-15\"\n }\n ],\n \"calculation_type\": \"amount | percentage\"\n },\n \"per_day_antecipated\": {\n \"amount\": 10,\n \"calculation_days\": \"working | calendar\",\n \"calculation_type\": \"amount | percentage\"\n }\n },\n \"due_date\": \"2025-12-16\",\n \"fine\": {\n \"amount\": 10,\n \"calculation_type\": \"amount | percentage\"\n },\n \"interest\": {\n \"amount\": 10,\n \"calculation_type\": \"daily_rate | monthly_fee | exempt | bank_control\"\n }\n },\n \"expiration_date\": \"2025-12-10\",\n \"external_id\": \"external id 123\",\n \"invoice_type\": \"invoice\",\n \"virtual_account_id\": \"0196f83d-cafa-f412-1f1d-129cdf2dda49\",\n \"wallet_type\": \"book_entry_electronic_bloquete\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://api.sandbox.trio.com.br/banking/cashin/boletos")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 402,\n \"counterparty\": {\n \"address\": \"Rua sem nome, 100\",\n \"city\": \"Curitiba\",\n \"district\": \"Centro\",\n \"name\": \"NOME DO PARTICIPANTE\",\n \"postal_code\": \"83706160\",\n \"state\": \"PR\",\n \"tax_number\": \"05964110000197\"\n },\n \"description\": \"Pago a trio.com.br\",\n \"due_detail\": {\n \"discount\": {\n \"fixed_until_due\": {\n \"amounts\": [\n {\n \"amount\": 10,\n \"date\": \"2025-12-13\"\n },\n {\n \"amount\": 9,\n \"date\": \"2025-12-14\"\n },\n {\n \"amount\": 8,\n \"date\": \"2025-12-15\"\n }\n ],\n \"calculation_type\": \"amount | percentage\"\n },\n \"per_day_antecipated\": {\n \"amount\": 10,\n \"calculation_days\": \"working | calendar\",\n \"calculation_type\": \"amount | percentage\"\n }\n },\n \"due_date\": \"2025-12-16\",\n \"fine\": {\n \"amount\": 10,\n \"calculation_type\": \"amount | percentage\"\n },\n \"interest\": {\n \"amount\": 10,\n \"calculation_type\": \"daily_rate | monthly_fee | exempt | bank_control\"\n }\n },\n \"expiration_date\": \"2025-12-10\",\n \"external_id\": \"external id 123\",\n \"invoice_type\": \"invoice\",\n \"virtual_account_id\": \"0196f83d-cafa-f412-1f1d-129cdf2dda49\",\n \"wallet_type\": \"book_entry_electronic_bloquete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/cashin/boletos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 402,\n \"counterparty\": {\n \"address\": \"Rua sem nome, 100\",\n \"city\": \"Curitiba\",\n \"district\": \"Centro\",\n \"name\": \"NOME DO PARTICIPANTE\",\n \"postal_code\": \"83706160\",\n \"state\": \"PR\",\n \"tax_number\": \"05964110000197\"\n },\n \"description\": \"Pago a trio.com.br\",\n \"due_detail\": {\n \"discount\": {\n \"fixed_until_due\": {\n \"amounts\": [\n {\n \"amount\": 10,\n \"date\": \"2025-12-13\"\n },\n {\n \"amount\": 9,\n \"date\": \"2025-12-14\"\n },\n {\n \"amount\": 8,\n \"date\": \"2025-12-15\"\n }\n ],\n \"calculation_type\": \"amount | percentage\"\n },\n \"per_day_antecipated\": {\n \"amount\": 10,\n \"calculation_days\": \"working | calendar\",\n \"calculation_type\": \"amount | percentage\"\n }\n },\n \"due_date\": \"2025-12-16\",\n \"fine\": {\n \"amount\": 10,\n \"calculation_type\": \"amount | percentage\"\n },\n \"interest\": {\n \"amount\": 10,\n \"calculation_type\": \"daily_rate | monthly_fee | exempt | bank_control\"\n }\n },\n \"expiration_date\": \"2025-12-10\",\n \"external_id\": \"external id 123\",\n \"invoice_type\": \"invoice\",\n \"virtual_account_id\": \"0196f83d-cafa-f412-1f1d-129cdf2dda49\",\n \"wallet_type\": \"book_entry_electronic_bloquete\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"amount": 10000,
"barcode": "12341111222233334444555566667777888899990000",
"boleto_url": "https://example.com/boleto_1",
"description": "description",
"digitable_line": "12341111222233334444555566667777888899990000",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{
"amount": 10,
"date": "2024-08-13"
},
{
"amount": 9,
"date": "2024-08-14"
},
{
"amount": 8,
"date": "2024-08-15"
}
],
"calculation_type": "amount"
},
"per_day_antecipated": {
"amount": 2,
"calculation_days": "working",
"calculation_type": "amount"
}
},
"due_date": "2024-08-10",
"fine": {
"amount": 10,
"calculation_type": "percentage"
},
"interest": {
"amount": 20,
"calculation_type": "daily_rate"
}
},
"expiration_date": "2024-08-30T23:59:59.999999Z",
"external_id": "0190b2a4-8a3b-d123-050e-8d659ace1e2d",
"id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"invoice_type": "commercial_duplicate",
"issue_date": "2024-07-24T10:00:00.000000Z",
"notes": [
"note 1",
"note 2",
"note 3"
],
"status": "confirmed",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"wallet_type": "direct_electronic_partial_emission_booklet"
}
}{
"error": {
"error_code": "UNAUTHORIZED",
"error_message": "Invalid credentials"
}
}{
"error": {
"error_code": "INTEGRATION_ERROR",
"error_message": "An unexpected issue occurred"
}
}Boleto
Create boleto
Creates a boleto
POST
/
banking
/
cashin
/
boletos
Create boleto
curl --request POST \
--url https://api.sandbox.trio.com.br/banking/cashin/boletos \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 402,
"counterparty": {
"address": "Rua sem nome, 100",
"city": "Curitiba",
"district": "Centro",
"name": "NOME DO PARTICIPANTE",
"postal_code": "83706160",
"state": "PR",
"tax_number": "05964110000197"
},
"description": "Pago a trio.com.br",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{
"amount": 10,
"date": "2025-12-13"
},
{
"amount": 9,
"date": "2025-12-14"
},
{
"amount": 8,
"date": "2025-12-15"
}
],
"calculation_type": "amount | percentage"
},
"per_day_antecipated": {
"amount": 10,
"calculation_days": "working | calendar",
"calculation_type": "amount | percentage"
}
},
"due_date": "2025-12-16",
"fine": {
"amount": 10,
"calculation_type": "amount | percentage"
},
"interest": {
"amount": 10,
"calculation_type": "daily_rate | monthly_fee | exempt | bank_control"
}
},
"expiration_date": "2025-12-10",
"external_id": "external id 123",
"invoice_type": "invoice",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"wallet_type": "book_entry_electronic_bloquete"
}
'import requests
url = "https://api.sandbox.trio.com.br/banking/cashin/boletos"
payload = {
"amount": 402,
"counterparty": {
"address": "Rua sem nome, 100",
"city": "Curitiba",
"district": "Centro",
"name": "NOME DO PARTICIPANTE",
"postal_code": "83706160",
"state": "PR",
"tax_number": "05964110000197"
},
"description": "Pago a trio.com.br",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{
"amount": 10,
"date": "2025-12-13"
},
{
"amount": 9,
"date": "2025-12-14"
},
{
"amount": 8,
"date": "2025-12-15"
}
],
"calculation_type": "amount | percentage"
},
"per_day_antecipated": {
"amount": 10,
"calculation_days": "working | calendar",
"calculation_type": "amount | percentage"
}
},
"due_date": "2025-12-16",
"fine": {
"amount": 10,
"calculation_type": "amount | percentage"
},
"interest": {
"amount": 10,
"calculation_type": "daily_rate | monthly_fee | exempt | bank_control"
}
},
"expiration_date": "2025-12-10",
"external_id": "external id 123",
"invoice_type": "invoice",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"wallet_type": "book_entry_electronic_bloquete"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 402,
counterparty: {
address: 'Rua sem nome, 100',
city: 'Curitiba',
district: 'Centro',
name: 'NOME DO PARTICIPANTE',
postal_code: '83706160',
state: 'PR',
tax_number: '05964110000197'
},
description: 'Pago a trio.com.br',
due_detail: {
discount: {
fixed_until_due: {
amounts: [
{amount: 10, date: '2025-12-13'},
{amount: 9, date: '2025-12-14'},
{amount: 8, date: '2025-12-15'}
],
calculation_type: 'amount | percentage'
},
per_day_antecipated: {
amount: 10,
calculation_days: 'working | calendar',
calculation_type: 'amount | percentage'
}
},
due_date: '2025-12-16',
fine: {amount: 10, calculation_type: 'amount | percentage'},
interest: {
amount: 10,
calculation_type: 'daily_rate | monthly_fee | exempt | bank_control'
}
},
expiration_date: '2025-12-10',
external_id: 'external id 123',
invoice_type: 'invoice',
virtual_account_id: '0196f83d-cafa-f412-1f1d-129cdf2dda49',
wallet_type: 'book_entry_electronic_bloquete'
})
};
fetch('https://api.sandbox.trio.com.br/banking/cashin/boletos', 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.trio.com.br/banking/cashin/boletos",
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([
'amount' => 402,
'counterparty' => [
'address' => 'Rua sem nome, 100',
'city' => 'Curitiba',
'district' => 'Centro',
'name' => 'NOME DO PARTICIPANTE',
'postal_code' => '83706160',
'state' => 'PR',
'tax_number' => '05964110000197'
],
'description' => 'Pago a trio.com.br',
'due_detail' => [
'discount' => [
'fixed_until_due' => [
'amounts' => [
[
'amount' => 10,
'date' => '2025-12-13'
],
[
'amount' => 9,
'date' => '2025-12-14'
],
[
'amount' => 8,
'date' => '2025-12-15'
]
],
'calculation_type' => 'amount | percentage'
],
'per_day_antecipated' => [
'amount' => 10,
'calculation_days' => 'working | calendar',
'calculation_type' => 'amount | percentage'
]
],
'due_date' => '2025-12-16',
'fine' => [
'amount' => 10,
'calculation_type' => 'amount | percentage'
],
'interest' => [
'amount' => 10,
'calculation_type' => 'daily_rate | monthly_fee | exempt | bank_control'
]
],
'expiration_date' => '2025-12-10',
'external_id' => 'external id 123',
'invoice_type' => 'invoice',
'virtual_account_id' => '0196f83d-cafa-f412-1f1d-129cdf2dda49',
'wallet_type' => 'book_entry_electronic_bloquete'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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.trio.com.br/banking/cashin/boletos"
payload := strings.NewReader("{\n \"amount\": 402,\n \"counterparty\": {\n \"address\": \"Rua sem nome, 100\",\n \"city\": \"Curitiba\",\n \"district\": \"Centro\",\n \"name\": \"NOME DO PARTICIPANTE\",\n \"postal_code\": \"83706160\",\n \"state\": \"PR\",\n \"tax_number\": \"05964110000197\"\n },\n \"description\": \"Pago a trio.com.br\",\n \"due_detail\": {\n \"discount\": {\n \"fixed_until_due\": {\n \"amounts\": [\n {\n \"amount\": 10,\n \"date\": \"2025-12-13\"\n },\n {\n \"amount\": 9,\n \"date\": \"2025-12-14\"\n },\n {\n \"amount\": 8,\n \"date\": \"2025-12-15\"\n }\n ],\n \"calculation_type\": \"amount | percentage\"\n },\n \"per_day_antecipated\": {\n \"amount\": 10,\n \"calculation_days\": \"working | calendar\",\n \"calculation_type\": \"amount | percentage\"\n }\n },\n \"due_date\": \"2025-12-16\",\n \"fine\": {\n \"amount\": 10,\n \"calculation_type\": \"amount | percentage\"\n },\n \"interest\": {\n \"amount\": 10,\n \"calculation_type\": \"daily_rate | monthly_fee | exempt | bank_control\"\n }\n },\n \"expiration_date\": \"2025-12-10\",\n \"external_id\": \"external id 123\",\n \"invoice_type\": \"invoice\",\n \"virtual_account_id\": \"0196f83d-cafa-f412-1f1d-129cdf2dda49\",\n \"wallet_type\": \"book_entry_electronic_bloquete\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://api.sandbox.trio.com.br/banking/cashin/boletos")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 402,\n \"counterparty\": {\n \"address\": \"Rua sem nome, 100\",\n \"city\": \"Curitiba\",\n \"district\": \"Centro\",\n \"name\": \"NOME DO PARTICIPANTE\",\n \"postal_code\": \"83706160\",\n \"state\": \"PR\",\n \"tax_number\": \"05964110000197\"\n },\n \"description\": \"Pago a trio.com.br\",\n \"due_detail\": {\n \"discount\": {\n \"fixed_until_due\": {\n \"amounts\": [\n {\n \"amount\": 10,\n \"date\": \"2025-12-13\"\n },\n {\n \"amount\": 9,\n \"date\": \"2025-12-14\"\n },\n {\n \"amount\": 8,\n \"date\": \"2025-12-15\"\n }\n ],\n \"calculation_type\": \"amount | percentage\"\n },\n \"per_day_antecipated\": {\n \"amount\": 10,\n \"calculation_days\": \"working | calendar\",\n \"calculation_type\": \"amount | percentage\"\n }\n },\n \"due_date\": \"2025-12-16\",\n \"fine\": {\n \"amount\": 10,\n \"calculation_type\": \"amount | percentage\"\n },\n \"interest\": {\n \"amount\": 10,\n \"calculation_type\": \"daily_rate | monthly_fee | exempt | bank_control\"\n }\n },\n \"expiration_date\": \"2025-12-10\",\n \"external_id\": \"external id 123\",\n \"invoice_type\": \"invoice\",\n \"virtual_account_id\": \"0196f83d-cafa-f412-1f1d-129cdf2dda49\",\n \"wallet_type\": \"book_entry_electronic_bloquete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/cashin/boletos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 402,\n \"counterparty\": {\n \"address\": \"Rua sem nome, 100\",\n \"city\": \"Curitiba\",\n \"district\": \"Centro\",\n \"name\": \"NOME DO PARTICIPANTE\",\n \"postal_code\": \"83706160\",\n \"state\": \"PR\",\n \"tax_number\": \"05964110000197\"\n },\n \"description\": \"Pago a trio.com.br\",\n \"due_detail\": {\n \"discount\": {\n \"fixed_until_due\": {\n \"amounts\": [\n {\n \"amount\": 10,\n \"date\": \"2025-12-13\"\n },\n {\n \"amount\": 9,\n \"date\": \"2025-12-14\"\n },\n {\n \"amount\": 8,\n \"date\": \"2025-12-15\"\n }\n ],\n \"calculation_type\": \"amount | percentage\"\n },\n \"per_day_antecipated\": {\n \"amount\": 10,\n \"calculation_days\": \"working | calendar\",\n \"calculation_type\": \"amount | percentage\"\n }\n },\n \"due_date\": \"2025-12-16\",\n \"fine\": {\n \"amount\": 10,\n \"calculation_type\": \"amount | percentage\"\n },\n \"interest\": {\n \"amount\": 10,\n \"calculation_type\": \"daily_rate | monthly_fee | exempt | bank_control\"\n }\n },\n \"expiration_date\": \"2025-12-10\",\n \"external_id\": \"external id 123\",\n \"invoice_type\": \"invoice\",\n \"virtual_account_id\": \"0196f83d-cafa-f412-1f1d-129cdf2dda49\",\n \"wallet_type\": \"book_entry_electronic_bloquete\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"amount": 10000,
"barcode": "12341111222233334444555566667777888899990000",
"boleto_url": "https://example.com/boleto_1",
"description": "description",
"digitable_line": "12341111222233334444555566667777888899990000",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{
"amount": 10,
"date": "2024-08-13"
},
{
"amount": 9,
"date": "2024-08-14"
},
{
"amount": 8,
"date": "2024-08-15"
}
],
"calculation_type": "amount"
},
"per_day_antecipated": {
"amount": 2,
"calculation_days": "working",
"calculation_type": "amount"
}
},
"due_date": "2024-08-10",
"fine": {
"amount": 10,
"calculation_type": "percentage"
},
"interest": {
"amount": 20,
"calculation_type": "daily_rate"
}
},
"expiration_date": "2024-08-30T23:59:59.999999Z",
"external_id": "0190b2a4-8a3b-d123-050e-8d659ace1e2d",
"id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"invoice_type": "commercial_duplicate",
"issue_date": "2024-07-24T10:00:00.000000Z",
"notes": [
"note 1",
"note 2",
"note 3"
],
"status": "confirmed",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"wallet_type": "direct_electronic_partial_emission_booklet"
}
}{
"error": {
"error_code": "UNAUTHORIZED",
"error_message": "Invalid credentials"
}
}{
"error": {
"error_code": "INTEGRATION_ERROR",
"error_message": "An unexpected issue occurred"
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Boleto payload
Body params to create a boleto
Amount of the boleto
Show child attributes
Show child attributes
Body params for boleto due detail
Show child attributes
Show child attributes
Example:
{
"discount": {
"fixed_until_due": {
"amounts": [
{ "amount": 10, "date": "2026-07-09" },
{ "amount": 10, "date": "2026-07-10" },
{ "amount": 10, "date": "2026-07-11" }
],
"calculation_type": "amount"
},
"per_day_antecipated": {
"amount": 10,
"calculation_days": "working",
"calculation_type": "amount"
}
},
"due_date": "2026-07-12",
"fine": {
"amount": 10,
"calculation_type": "percentage"
},
"interest": {
"amount": 10,
"calculation_type": "daily_rate"
}
}
Boleto invoice type
Available options:
commercial_duplicate, indicated_commercial_duplicate, service_duplicate, indicated_service_duplicate, rural_duplicate, bill_of_exchange, commercial_credit_note, export_credit_note, industrial_credit_note, rural_credit_note, promissory_note, rural_promissory_note, triplicate_commercial, triplicate_service, insurance_note, receipt, invoice, debit_note, insurance_policy, school_fee, consortium_installment, invoice_note, debt_document, rural_product_certificate, warrant, state_active_debt, municipal_active_debt, federal_active_debt, condominium_fee, credit_card, others Unique identifier
Boleto wallet type
Available options:
direct_electronic_partial_emission_booklet, book_entry_electronic_booklet, direct_electronic_with_emission_booklet, direct_electronic_no_emission_block_client, direct_electronic_no_emission_block_us, book_entry_electronic_bloquete, direct_electronic_no_emission_block_client2, direct_electronic_partial_emission_bloquete, direct_electronic_with_emission_bloquete, direct_electronic_no_emission_us_emission, direct_electronic_our_number_emission_banks_bloquete, direct_electronic_our_number_emission_banks_booklet Maximum string length:
25External ID
Maximum string length:
40Response
Created
Response for boleto
Response Params for boleto
Show child attributes
Show child attributes
Example:
{
"data": {
"amount": 10000,
"barcode": "12341111222233334444555566667777888899990000",
"boleto_url": "https://example.com/boleto_1",
"description": "description",
"digitable_line": "12341111222233334444555566667777888899990000",
"due_detail": {
"discount": {
"fixed_until_due": {
"amounts": [
{ "amount": 10, "date": "2024-08-13" },
{ "amount": 9, "date": "2024-08-14" },
{ "amount": 8, "date": "2024-08-15" }
],
"calculation_type": "amount"
},
"per_day_antecipated": {
"amount": 2,
"calculation_days": "working",
"calculation_type": "amount"
}
},
"due_date": "2024-08-10",
"fine": {
"amount": 10,
"calculation_type": "percentage"
},
"interest": {
"amount": 20,
"calculation_type": "daily_rate"
}
},
"expiration_date": "2024-08-30T23:59:59.999999Z",
"external_id": "0190b2a4-8a3b-d123-050e-8d659ace1e2d",
"id": "0196f83d-cafa-f412-1f1d-129cdf2dda49",
"issue_date": "2024-07-24T10:00:00.000000Z",
"notes": ["note 1", "note 2", "note 3"],
"status": "confirmed",
"virtual_account_id": "0196f83d-cafa-f412-1f1d-129cdf2dda49"
}
}
⌘I

