Learn how to charge your customers using Boletos on the Stark Bank platform.
A Boleto is a Brazilian payment slip that lets you collect payments from anyone with a bank account. You create it with an amount and payer details, and your customer pays it through their bank — online or at a physical location.
You can track each Boleto through its full life cycle: from creation to payment, expiration, or cancellation. Set up a webhook to receive updates automatically.
For advanced use cases, you can investigate payment status updates with Boleto Holmes.
NOTE: Read Core Concepts before continuing this guide.
For each environment (Sandbox or Production):
1. Create an account at Stark Bank.
2. Create a webhook with the following subscriptions to receive events at your desired URL:
boleto
2.1. Via Internet Banking:
Integrations > Webhook > New Webhook
2.2. Via API:
Use the POST /webhook route to create the webhook
The Sandbox environment simulates the full Boleto flow — creation, payment, and cancellation — without real money. Use it to test your integration before going live.
Sandbox vs Production: Stark Bank uses separate workspaces for each environment, each with its own URL and API keys. Changes in one environment don't affect the other.
If you don't have a Sandbox workspace yet, create one here:
A Boleto is a registered bar code used to receive payments from your customers. You provide the amount and the payer's details, and Stark Bank registers it with the central system (CIP/Núclea).
You can customize Boletos with due dates, fines, interest rates, discounts, descriptions, and tags. You can also specify a custom receiver name and tax ID.
Each Boleto has a status that can change over time according to its life cycle:
| Status | Description |
|---|---|
| Created | The Boleto was successfully created and is waiting to be registered. |
| Registered | The Boleto was registered with CIP and can now be paid. |
| Overdue | The Boleto has passed its due date and may now incur fines and interest. |
| Paid | The Boleto was paid by the payer. |
| Canceled | The Boleto was canceled and can no longer be paid. |
| Failed | The Boleto registration with CIP failed. |
Every time either you or Stark Bank makes a change to a Boleto, we create a Log. Logs are pretty useful for understanding the life cycle of each Boleto and the changes that happened to it. Here you can see the flow of possible logs:
| Log type | Status | Description |
|---|---|---|
| Created | Created | The Boleto was successfully created in Stark Bank. |
| Registered | Registered | The Boleto was registered with CIP and is ready to be paid. |
| Failed | Failed | The Boleto registration with CIP failed. |
| Overdue | Overdue | The Boleto has passed its due date. |
| Paid | Paid | The Boleto was paid by the payer. |
| Credited | Paid | The Boleto payment was credited to your account. |
| Canceling | Canceled | The Boleto is being canceled at CIP. |
| Canceled | Canceled | The Boleto was successfully canceled. |
id
Unique id for the boleto.
amount
Amount in cents to be charged. Example: 100 (R$1.00).
barCode
Boleto bar code.
city
Customer city name.
created
Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".
descriptions
List of description objects.
discounts
List of discount objects.
district
Customer district name.
due
Due date of the boleto. Example: "2020-04-23".
fee
Fee charged in cents.
fine
Percentage charged if paid after due date.
interest
Monthly percentage charged if paid after due date.
line
Boleto line number.
name
Customer full name.
ourNumber
Boleto control number (nosso numero).
overdueLimit
Number of days after due date until boleto expires.
receiverName
Name of the credit receiver (Sacador Avalista).
receiverTaxId
Tax ID of the credit receiver.
stateCode
Customer state code.
status
Current boleto status. Options: "created", "overdue", "paid", "canceled".
streetLine1
Customer street address.
streetLine2
Customer street address complement.
tags
Tags associated with the boleto.
taxId
Customer CPF or CNPJ.
transactionIds
Ledger transaction IDs linked to the boleto.
workspaceId
ID of the workspace that created the boleto.
zipCode
Customer zip code.
To create a Boleto, provide the required parameters: amount (in cents), the payer's name, tax ID (CPF or CNPJ), and full address.
You can also include optional parameters such as due date, fine, interest, overdue limit, receiver details, discounts, descriptions, and tags.
import starkbank
boletos = starkbank.boleto.create([
starkbank.Boleto(
amount=400000,
due="2020-05-20",
name="Iron Bank S.A.",
tax_id="20.018.183/0001-80",
street_line_1="Av. Faria Lima, 1844",
street_line_2="CJ 13",
district="Itaim Bibi",
city="São Paulo",
state_code="SP",
zip_code="01500-000",
tags=["war supply", "invoice #1234"]
)
])
for boleto in boletos:
print(boleto)
const starkbank = require('starkbank');
(async() => {
let boletos = await starkbank.boleto.create([
{
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
taxId: '20.018.183/0001-80',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
stateCode: 'SP',
zipCode: '01500-000',
tags: ['war supply', 'invoice #1234']
}
])
for (let boleto of boletos) {
console.log(boleto);
}
})();
use StarkBank\Boleto;
$boletos = Boleto::create([
new Boleto([
"amount" => 400000,
"due" => "2020-05-20",
"name" => "Iron Bank S.A.",
"taxId" => "20.018.183/0001-80",
"streetLine1" => "Av. Faria Lima, 1844",
"streetLine2" => "CJ 13",
"district" => "Itaim Bibi",
"city" => "São Paulo",
"stateCode" => "SP",
"zipCode" => "01500-000",
"tags" => ["war supply", "invoice #1234"]
])
]);
foreach($boletos as $boleto){
print_r($boleto);
}
import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
List<Boleto> boletos = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 400000);
data.put("due", "2020-05-20");
data.put("name", "Iron Bank S.A.");
data.put("taxId", "20.018.183/0001-80");
data.put("streetLine1", "Av. Faria Lima, 1844");
data.put("streetLine2", "CJ 13");
data.put("district", "Itaim Bibi");
data.put("city", "São Paulo");
data.put("stateCode", "SP");
data.put("zipCode", "01500-000");
data.put("tags", new String[]{"war supply", "invoice #1234"});
boletos.add(new Boleto(data));
boletos = Boleto.create(boletos);
for (Boleto boleto : boletos){
System.out.println(boleto);
}
require('starkbank')
boletos = StarkBank::Boleto.create([
StarkBank::Boleto.new(
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
tax_id: '20.018.183/0001-80',
street_line_1: 'Av. Faria Lima, 1844',
street_line_2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
state_code: 'SP',
zip_code: '01500-000',
tags: ['war supply', 'invoice #1234']
)
])
boletos.each do |boleto|
puts boleto
end
boletos = StarkBank.Boleto.create!(
[
%StarkBank.Boleto{
amount: 400000,
due: "2020-05-20",
name: "Iron Bank S.A.",
tax_id: "20.018.183/0001-80",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
state_code: "SP",
zip_code: "01500-000",
tags: ["war supply", "invoice #1234"]
}
]
) |> IO.inspect
using System;
using System.Collections.Generic;
List<StarkBank.Boleto> boletos = StarkBank.Boleto.Create(
new List<StarkBank.Boleto>() {
new StarkBank.Boleto(
amount: 400000,
due: new DateTime(2020, 05, 20),
name: "Iron Bank S.A.",
taxID: "20.018.183/0001-80",
streetLine1: "Av. Faria Lima, 1844",
streetLine2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
stateCode: "SP",
zipCode: "01500-000",
tags: new List<string> { "war supply", "invoice #1234" }
)
}
);
foreach(StarkBank.Boleto boleto in boletos)
{
Console.WriteLine(boleto);
}
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
"time"
)
func main() {
due := time.Date(2020, 05, 20, 0, 0, 0, 0, time.UTC)
boletos, err := boleto.Create(
[]boleto.Boleto{
{
Amount: 400000,
Due: &due,
Name: "Iron Bank S.A.",
TaxId: "20.018.183/0001-80",
StreetLine1: "Av. Faria Lima, 1844",
StreetLine2: "CJ 13",
District: "Itaim Bibi",
City: "São Paulo",
StateCode: "SP",
ZipCode: "01500-000",
Tags: []string{"war supply", "invoice #1234"},
},
}, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, boleto := range boletos {
fmt.Printf("%+v", boleto)
}
}
(def boletos (starkbank.boleto/create
[{
:amount 400000
:due "2020-05-20"
:name "Iron Bank S.A."
:tax-id "20.018.183/0001-80"
:street-line-1 "Av. Faria Lima, 1844"
:street-line-2 "CJ 13"
:district "Itaim Bibi"
:city "São Paulo"
:state-code "SP"
:zip-code "01500-000"
:tags ["war supply" "invoice #1234"]
}]))
(doseq [boleto boletos]
(println boleto))
curl --location --request POST '{{baseUrl}}/v2/boleto'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
--header 'Content-Type: application/json'
--data-raw '{
"boletos": [
{
"amount": 400000,
"due": "2020-05-20",
"name": "Iron Bank S.A.",
"taxId": "20.018.183/0001-80",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"district": "Itaim Bibi",
"city": "São Paulo",
"stateCode": "SP",
"zipCode": "01500-000",
"tags": ["war supply", "invoice #1234"]
}
]
}'
Boleto(
id=6655767935451136,
amount=400000,
bar_code=34191826100004000001091007175647307144464000,
city=São Paulo,
created=2020-04-23 23:36:08.129614,
descriptions=[],
discounts=[],
district=Itaim Bibi,
due=2020-05-21,
fee=0,
fine=2.5,
interest=1.3,
line=34191.09107 07175.647309 71444.640008 1 82610000400000,
name=Iron Bank S.A.,
our_number=10445145,
overdue_limit=5,
receiver_name=Winterfell S. A.,
receiver_tax_id=71.735.814/0001-12,
state_code=SP,
status=created,
street_line_1=Av. Faria Lima, 1844,
street_line_2=CJ 13,
tags=["war supply", "invoice #1234"],
tax_id=20.018.183/0001-80,
transaction_ids=[],
zip_code=01500-000,
workspace_id=5083989094170624
)
Boleto {
id: '6655767935451136',
amount: 400000,
barCode: '34191826100004000001091007175647307144464000',
city: 'São Paulo',
created: '2020-04-23T23:36:08.129614+00:00',
descriptions: [],
discounts: [],
district: 'Itaim Bibi',
due: '2020-05-21T02:59:59.999999+00:00',
fee: 0,
fine: 2.5,
interest: 1.3,
line: '34191.09107 07175.647309 71444.640008 1 82610000400000',
name: 'Iron Bank S.A.',
ourNumber: '10445145',
overdueLimit: 5,
receiverName: 'Winterfell S. A.',
receiverTaxId: '71.735.814/0001-12',
stateCode: 'SP',
status: 'created',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
tags: ['war supply', 'invoice #1234'],
taxId: '20.018.183/0001-80',
transactionIds: [],
zipCode: '01500-000',
workspaceId: '5083989094170624'
}
StarkBank\Boleto Object
(
[id] => 6655767935451136
[amount] => 400000
[barCode] => 34191826100004000001091007175647307144464000
[city] => São Paulo
[created] => DateTime Object
(
[date] => 2020-04-23 23:36:08.129614
[timezone_type] => 1
[timezone] => +00:00
)
[descriptions] => Array
(
)
[discounts] => Array
(
)
[district] => Itaim Bibi
[due] => DateTime Object
(
[date] => 2020-05-21 02:59:59.999999
[timezone_type] => 1
[timezone] => +00:00
)
[fee] => 0
[fine] => 2.5
[interest] => 1.3
[line] => 34191.09107 07175.647309 71444.640008 1 82610000400000
[name] => Iron Bank S.A.
[ourNumber] => 10445145
[overdueLimit] => 5
[receiverName] => Winterfell S. A.
[receiverTaxId] => 71.735.814/0001-12
[stateCode] => SP
[status] => created
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => CJ 13
[tags] => Array
(
[0] => war supply
[1] => invoice #1234
)
[taxId] => 20.018.183/0001-80
[transactionIds] => Array
(
)
[zipCode] => 01500-000
[workspaceId] => 5083989094170624
)
Boleto({
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
})
boleto(
id: 6655767935451136,
amount: 400000,
bar_code: 34191826100004000001091007175647307144464000,
city: São Paulo,
created: 2020-04-23T23:36:08+00:00,
descriptions: [],
discounts: [],
district: Itaim Bibi,
due: 2020-05-21T02:59:59+00:00,
fee: 0,
fine: 2.5,
interest: 1.3,
line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
name: Iron Bank S.A.,
our_number: 10445145,
overdue_limit: 5,
receiver_name: Winterfell S. A.,
receiver_tax_id: 71.735.814/0001-12,
state_code: SP,
status: created,
street_line_1: Av. Faria Lima, 1844,
street_line_2: CJ 13,
tags: ["war supply", "invoice #1234"],
tax_id: 20.018.183/0001-80,
transaction_ids: [],
zip_code: 01500-000,
workspace_id: 5083989094170624
)
%StarkBank.Boleto{
amount: 400000,
bar_code: "34191826100004000001091007175647307144464000",
city: "São Paulo",
created: ~U[2020-04-23 23:36:08.129614Z],
descriptions: [],
discounts: [],
district: "Itaim Bibi",
due: ~U[2020-05-21 02:59:59.999999Z],
fee: 0,
fine: 2.5,
id: "6655767935451136",
interest: 1.3,
line: "34191.09107 07175.647309 71444.640008 1 82610000400000",
name: "Iron Bank S.A.",
our_number: "10445145",
overdue_limit: 5,
receiver_name: "Winterfell S. A.",
receiver_tax_id: "71.735.814/0001-12",
state_code: "SP",
status: "created",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
tags: ["war supply", "invoice #1234"],
tax_id: "20.018.183/0001-80",
transaction_ids: [],
zip_code: "01500-000",
workspace_id: "5083989094170624"
}
Boleto(
Amount: 400000,
BarCode: 34191826100004000001091007175647307144464000,
City: São Paulo,
Created: 04/23/2020 23:36:08,
Descriptions: { },
Discounts: { },
District: Itaim Bibi,
Due: 05/21/2020 02:59:59,
Fee: 0,
Fine: 2.5,
ID: 6655767935451136,
Interest: 1.3,
Line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
Name: Iron Bank S.A.,
OurNumber: 10445145,
OverdueLimit: 5,
ReceiverName: Winterfell S. A.,
ReceiverTaxId: 71.735.814/0001-12,
StateCode: SP,
Status: created,
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: CJ 13,
Tags: { war supply, invoice #1234 },
TaxId: 20.018.183/0001-80,
TransactionIds: { },
ZipCode: 01500-000,
WorkspaceId: 5083989094170624
)
{
Id:6655767935451136
Amount:400000
BarCode:34191826100004000001091007175647307144464000
City:São Paulo
Created:2020-04-23 23:36:08.129614 +0000 +0000
Descriptions:[]
Discounts:[]
District:Itaim Bibi
Due:2020-05-21 02:59:59.999999 +0000 +0000
Fee:0
Fine:2.5
Interest:1.3
Line:34191.09107 07175.647309 71444.640008 1 82610000400000
Name:Iron Bank S.A.
OurNumber:10445145
OverdueLimit:5
ReceiverName:Winterfell S. A.
ReceiverTaxId:71.735.814/0001-12
StateCode:SP
Status:created
StreetLine1:Av. Faria Lima, 1844
StreetLine2:CJ 13
Tags:[war supply invoice #1234]
TaxId:20.018.183/0001-80
TransactionIds:[]
ZipCode:01500-000
WorkspaceId:5083989094170624
}
{
:id 6655767935451136,
:amount 400000,
:bar-code 34191826100004000001091007175647307144464000,
:city São Paulo,
:created 2020-04-23T23:36:08.129614+00:00,
:descriptions [],
:discounts [],
:district Itaim Bibi,
:due 2020-05-21T02:59:59.999999+00:00,
:fee 0,
:fine 2.5,
:interest 1.3,
:line 34191.09107 07175.647309 71444.640008 1 82610000400000,
:name Iron Bank S.A.,
:our-number 10445145,
:overdue-limit 5,
:receiver-name Winterfell S. A.,
:receiver-tax-id 71.735.814/0001-12,
:state-code SP,
:status created,
:street-line-1 Av. Faria Lima, 1844,
:street-line-2 CJ 13,
:tags [war supply invoice #1234],
:tax-id 20.018.183/0001-80,
:transaction-ids [],
:zip-code 01500-000,
:workspace-id 5083989094170624
}
{
"message": "Boleto(s) successfully created",
"boletos": [
{
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
]
}
You can set a due date for the Boleto in ISO format. The default due date is 2 days after creation.
Use fine to charge a percentage if the customer pays after the due date. Use interest to add monthly interest. Use overdueLimit to set how many seconds after the due date the Boleto stays valid (default: 5,097,600 seconds, or 59 days).
import starkbank
boletos = starkbank.boleto.create([
starkbank.Boleto(
amount=400000,
due="2020-05-20",
name="Iron Bank S.A.",
tax_id="20.018.183/0001-80",
fine=2.5,
interest=1.3,
overdue_limit=5,
street_line_1="Av. Faria Lima, 1844",
street_line_2="CJ 13",
district="Itaim Bibi",
city="São Paulo",
state_code="SP",
zip_code="01500-000",
tags=["war supply", "invoice #1234"]
)
])
for boleto in boletos:
print(boleto)
const starkbank = require('starkbank');
(async() => {
let boletos = await starkbank.boleto.create([
{
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
taxId: '20.018.183/0001-80',
fine: 2.5,
interest: 1.3,
overdueLimit: 5,
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
stateCode: 'SP',
zipCode: '01500-000',
tags: ['war supply', 'invoice #1234']
}
])
for (let boleto of boletos) {
console.log(boleto);
}
})();
use StarkBank\Boleto;
$boletos = Boleto::create([
new Boleto([
"amount" => 400000,
"due" => "2020-05-20",
"name" => "Iron Bank S.A.",
"taxId" => "20.018.183/0001-80",
"fine" => 2.5,
"interest" => 1.3,
"overdueLimit" => 5,
"streetLine1" => "Av. Faria Lima, 1844",
"streetLine2" => "CJ 13",
"district" => "Itaim Bibi",
"city" => "São Paulo",
"stateCode" => "SP",
"zipCode" => "01500-000",
"tags" => ["war supply", "invoice #1234"]
])
]);
foreach($boletos as $boleto){
print_r($boleto);
}
import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
List<Boleto> boletos = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 400000);
data.put("due", "2020-05-20");
data.put("name", "Iron Bank S.A.");
data.put("taxId", "20.018.183/0001-80");
data.put("fine", 2.5);
data.put("interest", 1.3);
data.put("overdueLimit", 5);
data.put("streetLine1", "Av. Faria Lima, 1844");
data.put("streetLine2", "CJ 13");
data.put("district", "Itaim Bibi");
data.put("city", "São Paulo");
data.put("stateCode", "SP");
data.put("zipCode", "01500-000");
data.put("tags", new String[]{"war supply", "invoice #1234"});
boletos.add(new Boleto(data));
boletos = Boleto.create(boletos);
for (Boleto boleto : boletos){
System.out.println(boleto);
}
require('starkbank')
boletos = StarkBank::Boleto.create([
StarkBank::Boleto.new(
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
tax_id: '20.018.183/0001-80',
fine: 2.5,
interest: 1.3,
overdue_limit: 5,
street_line_1: 'Av. Faria Lima, 1844',
street_line_2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
state_code: 'SP',
zip_code: '01500-000',
tags: ['war supply', 'invoice #1234']
)
])
boletos.each do |boleto|
puts boleto
end
boletos = StarkBank.Boleto.create!(
[
%StarkBank.Boleto{
amount: 400000,
due: "2020-05-20",
name: "Iron Bank S.A.",
tax_id: "20.018.183/0001-80",
fine: 2.5,
interest: 1.3,
overdue_limit: 5,
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
state_code: "SP",
zip_code: "01500-000",
tags: ["war supply", "invoice #1234"]
}
]
) |> IO.inspect
using System;
using System.Collections.Generic;
List<StarkBank.Boleto> boletos = StarkBank.Boleto.Create(
new List<StarkBank.Boleto>() {
new StarkBank.Boleto(
amount: 400000,
due: new DateTime(2020, 05, 20),
name: "Iron Bank S.A.",
taxID: "20.018.183/0001-80",
fine: 2.5,
interest: 1.3,
overdueLimit: 5,
streetLine1: "Av. Faria Lima, 1844",
streetLine2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
stateCode: "SP",
zipCode: "01500-000",
tags: new List<string> { "war supply", "invoice #1234" }
)
}
);
foreach(StarkBank.Boleto boleto in boletos)
{
Console.WriteLine(boleto);
}
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
"time"
)
func main() {
due := time.Date(2020, 05, 20, 0, 0, 0, 0, time.UTC)
boletos, err := boleto.Create(
[]boleto.Boleto{
{
Amount: 400000,
Due: &due,
Name: "Iron Bank S.A.",
TaxId: "20.018.183/0001-80",
Fine: 2.5,
Interest: 1.3,
OverdueLimit: 5,
StreetLine1: "Av. Faria Lima, 1844",
StreetLine2: "CJ 13",
District: "Itaim Bibi",
City: "São Paulo",
StateCode: "SP",
ZipCode: "01500-000",
Tags: []string{"war supply", "invoice #1234"},
},
}, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, boleto := range boletos {
fmt.Printf("%+v", boleto)
}
}
(def boletos (starkbank.boleto/create
[{
:amount 400000
:due "2020-05-20"
:name "Iron Bank S.A."
:tax-id "20.018.183/0001-80"
:fine 2.5
:interest 1.3
:overdue-limit 5
:street-line-1 "Av. Faria Lima, 1844"
:street-line-2 "CJ 13"
:district "Itaim Bibi"
:city "São Paulo"
:state-code "SP"
:zip-code "01500-000"
:tags ["war supply" "invoice #1234"]
}]))
(doseq [boleto boletos]
(println boleto))
curl --location --request POST '{{baseUrl}}/v2/boleto'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
--header 'Content-Type: application/json'
--data-raw '{
"boletos": [
{
"amount": 400000,
"due": "2020-05-20",
"name": "Iron Bank S.A.",
"taxId": "20.018.183/0001-80",
"fine": 2.5,
"interest": 1.3,
"overdueLimit": 5,
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"district": "Itaim Bibi",
"city": "São Paulo",
"stateCode": "SP",
"zipCode": "01500-000",
"tags": ["war supply", "invoice #1234"]
}
]
}'
Boleto(
id=6655767935451136,
amount=400000,
bar_code=34191826100004000001091007175647307144464000,
city=São Paulo,
created=2020-04-23 23:36:08.129614,
descriptions=[],
discounts=[],
district=Itaim Bibi,
due=2020-05-21,
fee=0,
fine=2.5,
interest=1.3,
line=34191.09107 07175.647309 71444.640008 1 82610000400000,
name=Iron Bank S.A.,
our_number=10445145,
overdue_limit=5,
receiver_name=Winterfell S. A.,
receiver_tax_id=71.735.814/0001-12,
state_code=SP,
status=created,
street_line_1=Av. Faria Lima, 1844,
street_line_2=CJ 13,
tags=["war supply", "invoice #1234"],
tax_id=20.018.183/0001-80,
transaction_ids=[],
zip_code=01500-000,
workspace_id=5083989094170624
)
Boleto {
id: '6655767935451136',
amount: 400000,
barCode: '34191826100004000001091007175647307144464000',
city: 'São Paulo',
created: '2020-04-23T23:36:08.129614+00:00',
descriptions: [],
discounts: [],
district: 'Itaim Bibi',
due: '2020-05-21T02:59:59.999999+00:00',
fee: 0,
fine: 2.5,
interest: 1.3,
line: '34191.09107 07175.647309 71444.640008 1 82610000400000',
name: 'Iron Bank S.A.',
ourNumber: '10445145',
overdueLimit: 5,
receiverName: 'Winterfell S. A.',
receiverTaxId: '71.735.814/0001-12',
stateCode: 'SP',
status: 'created',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
tags: ['war supply', 'invoice #1234'],
taxId: '20.018.183/0001-80',
transactionIds: [],
zipCode: '01500-000',
workspaceId: '5083989094170624'
}
StarkBank\Boleto Object
(
[id] => 6655767935451136
[amount] => 400000
[barCode] => 34191826100004000001091007175647307144464000
[city] => São Paulo
[created] => DateTime Object
(
[date] => 2020-04-23 23:36:08.129614
[timezone_type] => 1
[timezone] => +00:00
)
[descriptions] => Array
(
)
[discounts] => Array
(
)
[district] => Itaim Bibi
[due] => DateTime Object
(
[date] => 2020-05-21 02:59:59.999999
[timezone_type] => 1
[timezone] => +00:00
)
[fee] => 0
[fine] => 2.5
[interest] => 1.3
[line] => 34191.09107 07175.647309 71444.640008 1 82610000400000
[name] => Iron Bank S.A.
[ourNumber] => 10445145
[overdueLimit] => 5
[receiverName] => Winterfell S. A.
[receiverTaxId] => 71.735.814/0001-12
[stateCode] => SP
[status] => created
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => CJ 13
[tags] => Array
(
[0] => war supply
[1] => invoice #1234
)
[taxId] => 20.018.183/0001-80
[transactionIds] => Array
(
)
[zipCode] => 01500-000
[workspaceId] => 5083989094170624
)
Boleto({
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
})
boleto(
id: 6655767935451136,
amount: 400000,
bar_code: 34191826100004000001091007175647307144464000,
city: São Paulo,
created: 2020-04-23T23:36:08+00:00,
descriptions: [],
discounts: [],
district: Itaim Bibi,
due: 2020-05-21T02:59:59+00:00,
fee: 0,
fine: 2.5,
interest: 1.3,
line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
name: Iron Bank S.A.,
our_number: 10445145,
overdue_limit: 5,
receiver_name: Winterfell S. A.,
receiver_tax_id: 71.735.814/0001-12,
state_code: SP,
status: created,
street_line_1: Av. Faria Lima, 1844,
street_line_2: CJ 13,
tags: ["war supply", "invoice #1234"],
tax_id: 20.018.183/0001-80,
transaction_ids: [],
zip_code: 01500-000,
workspace_id: 5083989094170624
)
%StarkBank.Boleto{
amount: 400000,
bar_code: "34191826100004000001091007175647307144464000",
city: "São Paulo",
created: ~U[2020-04-23 23:36:08.129614Z],
descriptions: [],
discounts: [],
district: "Itaim Bibi",
due: ~U[2020-05-21 02:59:59.999999Z],
fee: 0,
fine: 2.5,
id: "6655767935451136",
interest: 1.3,
line: "34191.09107 07175.647309 71444.640008 1 82610000400000",
name: "Iron Bank S.A.",
our_number: "10445145",
overdue_limit: 5,
receiver_name: "Winterfell S. A.",
receiver_tax_id: "71.735.814/0001-12",
state_code: "SP",
status: "created",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
tags: ["war supply", "invoice #1234"],
tax_id: "20.018.183/0001-80",
transaction_ids: [],
zip_code: "01500-000",
workspace_id: "5083989094170624"
}
Boleto(
Amount: 400000,
BarCode: 34191826100004000001091007175647307144464000,
City: São Paulo,
Created: 04/23/2020 23:36:08,
Descriptions: { },
Discounts: { },
District: Itaim Bibi,
Due: 05/21/2020 02:59:59,
Fee: 0,
Fine: 2.5,
ID: 6655767935451136,
Interest: 1.3,
Line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
Name: Iron Bank S.A.,
OurNumber: 10445145,
OverdueLimit: 5,
ReceiverName: Winterfell S. A.,
ReceiverTaxId: 71.735.814/0001-12,
StateCode: SP,
Status: created,
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: CJ 13,
Tags: { war supply, invoice #1234 },
TaxId: 20.018.183/0001-80,
TransactionIds: { },
ZipCode: 01500-000,
WorkspaceId: 5083989094170624
)
{
Id:6655767935451136
Amount:400000
BarCode:34191826100004000001091007175647307144464000
City:São Paulo
Created:2020-04-23 23:36:08.129614 +0000 +0000
Descriptions:[]
Discounts:[]
District:Itaim Bibi
Due:2020-05-21 02:59:59.999999 +0000 +0000
Fee:0
Fine:2.5
Interest:1.3
Line:34191.09107 07175.647309 71444.640008 1 82610000400000
Name:Iron Bank S.A.
OurNumber:10445145
OverdueLimit:5
ReceiverName:Winterfell S. A.
ReceiverTaxId:71.735.814/0001-12
StateCode:SP
Status:created
StreetLine1:Av. Faria Lima, 1844
StreetLine2:CJ 13
Tags:[war supply invoice #1234]
TaxId:20.018.183/0001-80
TransactionIds:[]
ZipCode:01500-000
WorkspaceId:5083989094170624
}
{
:id 6655767935451136,
:amount 400000,
:bar-code 34191826100004000001091007175647307144464000,
:city São Paulo,
:created 2020-04-23T23:36:08.129614+00:00,
:descriptions [],
:discounts [],
:district Itaim Bibi,
:due 2020-05-21T02:59:59.999999+00:00,
:fee 0,
:fine 2.5,
:interest 1.3,
:line 34191.09107 07175.647309 71444.640008 1 82610000400000,
:name Iron Bank S.A.,
:our-number 10445145,
:overdue-limit 5,
:receiver-name Winterfell S. A.,
:receiver-tax-id 71.735.814/0001-12,
:state-code SP,
:status created,
:street-line-1 Av. Faria Lima, 1844,
:street-line-2 CJ 13,
:tags [war supply invoice #1234],
:tax-id 20.018.183/0001-80,
:transaction-ids [],
:zip-code 01500-000,
:workspace-id 5083989094170624
}
{
"message": "Boleto(s) successfully created",
"boletos": [
{
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
]
}
You can set a custom receiver name and tax ID (Sacador Avalista) for the Boleto. If not provided, the workspace owner's name and tax ID are used.
Both receiverName and receiverTaxId must be provided together.
import starkbank
boletos = starkbank.boleto.create([
starkbank.Boleto(
amount=400000,
due="2020-05-20",
name="Iron Bank S.A.",
tax_id="20.018.183/0001-80",
receiver_name="Night King",
receiver_tax_id="012.345.678-90",
street_line_1="Av. Faria Lima, 1844",
street_line_2="CJ 13",
district="Itaim Bibi",
city="São Paulo",
state_code="SP",
zip_code="01500-000",
tags=["war supply", "invoice #1234"]
)
])
for boleto in boletos:
print(boleto)
const starkbank = require('starkbank');
(async() => {
let boletos = await starkbank.boleto.create([
{
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
taxId: '20.018.183/0001-80',
receiverName: 'Night King',
receiverTaxId: '012.345.678-90',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
stateCode: 'SP',
zipCode: '01500-000',
tags: ['war supply', 'invoice #1234']
}
])
for (let boleto of boletos) {
console.log(boleto);
}
})();
use StarkBank\Boleto;
$boletos = Boleto::create([
new Boleto([
"amount" => 400000,
"due" => "2020-05-20",
"name" => "Iron Bank S.A.",
"taxId" => "20.018.183/0001-80",
"receiverName" => "Night King",
"receiverTaxId" => "012.345.678-90",
"streetLine1" => "Av. Faria Lima, 1844",
"streetLine2" => "CJ 13",
"district" => "Itaim Bibi",
"city" => "São Paulo",
"stateCode" => "SP",
"zipCode" => "01500-000",
"tags" => ["war supply", "invoice #1234"]
])
]);
foreach($boletos as $boleto){
print_r($boleto);
}
import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
List<Boleto> boletos = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 400000);
data.put("due", "2020-05-20");
data.put("name", "Iron Bank S.A.");
data.put("taxId", "20.018.183/0001-80");
data.put("receiverName", "Night King");
data.put("receiverTaxId", "012.345.678-90");
data.put("streetLine1", "Av. Faria Lima, 1844");
data.put("streetLine2", "CJ 13");
data.put("district", "Itaim Bibi");
data.put("city", "São Paulo");
data.put("stateCode", "SP");
data.put("zipCode", "01500-000");
data.put("tags", new String[]{"war supply", "invoice #1234"});
boletos.add(new Boleto(data));
boletos = Boleto.create(boletos);
for (Boleto boleto : boletos){
System.out.println(boleto);
}
require('starkbank')
boletos = StarkBank::Boleto.create([
StarkBank::Boleto.new(
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
tax_id: '20.018.183/0001-80',
receiver_name: 'Night King',
receiver_tax_id: '012.345.678-90',
street_line_1: 'Av. Faria Lima, 1844',
street_line_2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
state_code: 'SP',
zip_code: '01500-000',
tags: ['war supply', 'invoice #1234']
)
])
boletos.each do |boleto|
puts boleto
end
boletos = StarkBank.Boleto.create!(
[
%StarkBank.Boleto{
amount: 400000,
due: "2020-05-20",
name: "Iron Bank S.A.",
tax_id: "20.018.183/0001-80",
receiver_name: "Night King",
receiver_tax_id: "012.345.678-90",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
state_code: "SP",
zip_code: "01500-000",
tags: ["war supply", "invoice #1234"]
}
]
) |> IO.inspect
using System;
using System.Collections.Generic;
List<StarkBank.Boleto> boletos = StarkBank.Boleto.Create(
new List<StarkBank.Boleto>() {
new StarkBank.Boleto(
amount: 400000,
due: new DateTime(2020, 05, 20),
name: "Iron Bank S.A.",
taxID: "20.018.183/0001-80",
receiverName: "Night King",
receiverTaxId: "012.345.678-90",
streetLine1: "Av. Faria Lima, 1844",
streetLine2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
stateCode: "SP",
zipCode: "01500-000",
tags: new List<string> { "war supply", "invoice #1234" }
)
}
);
foreach(StarkBank.Boleto boleto in boletos)
{
Console.WriteLine(boleto);
}
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
"time"
)
func main() {
due := time.Date(2020, 05, 20, 0, 0, 0, 0, time.UTC)
boletos, err := boleto.Create(
[]boleto.Boleto{
{
Amount: 400000,
Due: &due,
Name: "Iron Bank S.A.",
TaxId: "20.018.183/0001-80",
ReceiverName: "Night King",
ReceiverTaxId: "012.345.678-90",
StreetLine1: "Av. Faria Lima, 1844",
StreetLine2: "CJ 13",
District: "Itaim Bibi",
City: "São Paulo",
StateCode: "SP",
ZipCode: "01500-000",
Tags: []string{"war supply", "invoice #1234"},
},
}, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, boleto := range boletos {
fmt.Printf("%+v", boleto)
}
}
(def boletos (starkbank.boleto/create
[{
:amount 400000
:due "2020-05-20"
:name "Iron Bank S.A."
:tax-id "20.018.183/0001-80"
:receiver-name "Night King"
:receiver-tax-id "012.345.678-90"
:street-line-1 "Av. Faria Lima, 1844"
:street-line-2 "CJ 13"
:district "Itaim Bibi"
:city "São Paulo"
:state-code "SP"
:zip-code "01500-000"
:tags ["war supply" "invoice #1234"]
}]))
(doseq [boleto boletos]
(println boleto))
curl --location --request POST '{{baseUrl}}/v2/boleto'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
--header 'Content-Type: application/json'
--data-raw '{
"boletos": [
{
"amount": 400000,
"due": "2020-05-20",
"name": "Iron Bank S.A.",
"taxId": "20.018.183/0001-80",
"receiverName": "Night King",
"receiverTaxId": "012.345.678-90",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"district": "Itaim Bibi",
"city": "São Paulo",
"stateCode": "SP",
"zipCode": "01500-000",
"tags": ["war supply", "invoice #1234"]
}
]
}'
Boleto(
id=6655767935451136,
amount=400000,
bar_code=34191826100004000001091007175647307144464000,
city=São Paulo,
created=2020-04-23 23:36:08.129614,
descriptions=[],
discounts=[],
district=Itaim Bibi,
due=2020-05-21,
fee=0,
fine=2.5,
interest=1.3,
line=34191.09107 07175.647309 71444.640008 1 82610000400000,
name=Iron Bank S.A.,
our_number=10445145,
overdue_limit=5,
receiver_name=Night King,
receiver_tax_id=012.345.678-90,
state_code=SP,
status=created,
street_line_1=Av. Faria Lima, 1844,
street_line_2=CJ 13,
tags=["war supply", "invoice #1234"],
tax_id=20.018.183/0001-80,
transaction_ids=[],
zip_code=01500-000,
workspace_id=5083989094170624
)
Boleto {
id: '6655767935451136',
amount: 400000,
barCode: '34191826100004000001091007175647307144464000',
city: 'São Paulo',
created: '2020-04-23T23:36:08.129614+00:00',
descriptions: [],
discounts: [],
district: 'Itaim Bibi',
due: '2020-05-21T02:59:59.999999+00:00',
fee: 0,
fine: 2.5,
interest: 1.3,
line: '34191.09107 07175.647309 71444.640008 1 82610000400000',
name: 'Iron Bank S.A.',
ourNumber: '10445145',
overdueLimit: 5,
receiverName: 'Night King',
receiverTaxId: '012.345.678-90',
stateCode: 'SP',
status: 'created',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
tags: ['war supply', 'invoice #1234'],
taxId: '20.018.183/0001-80',
transactionIds: [],
zipCode: '01500-000',
workspaceId: '5083989094170624'
}
StarkBank\Boleto Object
(
[id] => 6655767935451136
[amount] => 400000
[barCode] => 34191826100004000001091007175647307144464000
[city] => São Paulo
[created] => DateTime Object
(
[date] => 2020-04-23 23:36:08.129614
[timezone_type] => 1
[timezone] => +00:00
)
[descriptions] => Array
(
)
[discounts] => Array
(
)
[district] => Itaim Bibi
[due] => DateTime Object
(
[date] => 2020-05-21 02:59:59.999999
[timezone_type] => 1
[timezone] => +00:00
)
[fee] => 0
[fine] => 2.5
[interest] => 1.3
[line] => 34191.09107 07175.647309 71444.640008 1 82610000400000
[name] => Iron Bank S.A.
[ourNumber] => 10445145
[overdueLimit] => 5
[receiverName] => Night King
[receiverTaxId] => 012.345.678-90
[stateCode] => SP
[status] => created
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => CJ 13
[tags] => Array
(
[0] => war supply
[1] => invoice #1234
)
[taxId] => 20.018.183/0001-80
[transactionIds] => Array
(
)
[zipCode] => 01500-000
[workspaceId] => 5083989094170624
)
Boleto({
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Night King",
"receiverTaxId": "012.345.678-90",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
})
boleto(
id: 6655767935451136,
amount: 400000,
bar_code: 34191826100004000001091007175647307144464000,
city: São Paulo,
created: 2020-04-23T23:36:08+00:00,
descriptions: [],
discounts: [],
district: Itaim Bibi,
due: 2020-05-21T02:59:59+00:00,
fee: 0,
fine: 2.5,
interest: 1.3,
line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
name: Iron Bank S.A.,
our_number: 10445145,
overdue_limit: 5,
receiver_name: Night King,
receiver_tax_id: 012.345.678-90,
state_code: SP,
status: created,
street_line_1: Av. Faria Lima, 1844,
street_line_2: CJ 13,
tags: ["war supply", "invoice #1234"],
tax_id: 20.018.183/0001-80,
transaction_ids: [],
zip_code: 01500-000,
workspace_id: 5083989094170624
)
%StarkBank.Boleto{
amount: 400000,
bar_code: "34191826100004000001091007175647307144464000",
city: "São Paulo",
created: ~U[2020-04-23 23:36:08.129614Z],
descriptions: [],
discounts: [],
district: "Itaim Bibi",
due: ~U[2020-05-21 02:59:59.999999Z],
fee: 0,
fine: 2.5,
id: "6655767935451136",
interest: 1.3,
line: "34191.09107 07175.647309 71444.640008 1 82610000400000",
name: "Iron Bank S.A.",
our_number: "10445145",
overdue_limit: 5,
receiver_name: "Night King",
receiver_tax_id: "012.345.678-90",
state_code: "SP",
status: "created",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
tags: ["war supply", "invoice #1234"],
tax_id: "20.018.183/0001-80",
transaction_ids: [],
zip_code: "01500-000",
workspace_id: "5083989094170624"
}
Boleto(
Amount: 400000,
BarCode: 34191826100004000001091007175647307144464000,
City: São Paulo,
Created: 04/23/2020 23:36:08,
Descriptions: { },
Discounts: { },
District: Itaim Bibi,
Due: 05/21/2020 02:59:59,
Fee: 0,
Fine: 2.5,
ID: 6655767935451136,
Interest: 1.3,
Line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
Name: Iron Bank S.A.,
OurNumber: 10445145,
OverdueLimit: 5,
ReceiverName: Night King,
ReceiverTaxId: 012.345.678-90,
StateCode: SP,
Status: created,
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: CJ 13,
Tags: { war supply, invoice #1234 },
TaxId: 20.018.183/0001-80,
TransactionIds: { },
ZipCode: 01500-000,
WorkspaceId: 5083989094170624
)
{
Id:6655767935451136
Amount:400000
BarCode:34191826100004000001091007175647307144464000
City:São Paulo
Created:2020-04-23 23:36:08.129614 +0000 +0000
Descriptions:[]
Discounts:[]
District:Itaim Bibi
Due:2020-05-21 02:59:59.999999 +0000 +0000
Fee:0
Fine:2.5
Interest:1.3
Line:34191.09107 07175.647309 71444.640008 1 82610000400000
Name:Iron Bank S.A.
OurNumber:10445145
OverdueLimit:5
ReceiverName:Night King
ReceiverTaxId:012.345.678-90
StateCode:SP
Status:created
StreetLine1:Av. Faria Lima, 1844
StreetLine2:CJ 13
Tags:[war supply invoice #1234]
TaxId:20.018.183/0001-80
TransactionIds:[]
ZipCode:01500-000
WorkspaceId:5083989094170624
}
{
:id 6655767935451136,
:amount 400000,
:bar-code 34191826100004000001091007175647307144464000,
:city São Paulo,
:created 2020-04-23T23:36:08.129614+00:00,
:descriptions [],
:discounts [],
:district Itaim Bibi,
:due 2020-05-21T02:59:59.999999+00:00,
:fee 0,
:fine 2.5,
:interest 1.3,
:line 34191.09107 07175.647309 71444.640008 1 82610000400000,
:name Iron Bank S.A.,
:our-number 10445145,
:overdue-limit 5,
:receiver-name Night King,
:receiver-tax-id 012.345.678-90,
:state-code SP,
:status created,
:street-line-1 Av. Faria Lima, 1844,
:street-line-2 CJ 13,
:tags [war supply invoice #1234],
:tax-id 20.018.183/0001-80,
:transaction-ids [],
:zip-code 01500-000,
:workspace-id 5083989094170624
}
{
"message": "Boleto(s) successfully created",
"boletos": [
{
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Night King",
"receiverTaxId": "012.345.678-90",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
]
}
Use discounts to offer up to 5 early-payment discounts, each with a percentage and a deadline.
Use tags to label the Boleto for easier filtering and organization. Tags are converted to lowercase.
Use descriptions to add up to 15 key-value pairs that explain the reason for the charge.
import starkbank
boletos = starkbank.boleto.create([
starkbank.Boleto(
amount=400000,
due="2020-05-20",
name="Iron Bank S.A.",
tax_id="20.018.183/0001-80",
street_line_1="Av. Faria Lima, 1844",
street_line_2="CJ 13",
district="Itaim Bibi",
city="São Paulo",
state_code="SP",
zip_code="01500-000",
tags=["war supply", "invoice #1234"],
discounts=[
{"percentage": 10, "date": "2020-04-25"}
]
)
])
for boleto in boletos:
print(boleto)
const starkbank = require('starkbank');
(async() => {
let boletos = await starkbank.boleto.create([
{
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
taxId: '20.018.183/0001-80',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
stateCode: 'SP',
zipCode: '01500-000',
tags: ['war supply', 'invoice #1234'],
discounts: [
{percentage: 10, date: '2020-04-25'}
]
}
])
for (let boleto of boletos) {
console.log(boleto);
}
})();
use StarkBank\Boleto;
$boletos = Boleto::create([
new Boleto([
"amount" => 400000,
"due" => "2020-05-20",
"name" => "Iron Bank S.A.",
"taxId" => "20.018.183/0001-80",
"streetLine1" => "Av. Faria Lima, 1844",
"streetLine2" => "CJ 13",
"district" => "Itaim Bibi",
"city" => "São Paulo",
"stateCode" => "SP",
"zipCode" => "01500-000",
"tags" => ["war supply", "invoice #1234"],
"discounts" => [
["percentage" => 10, "date" => "2020-04-25"]
]
])
]);
foreach($boletos as $boleto){
print_r($boleto);
}
import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
List<HashMap<String, Object>> discounts = new ArrayList<>();
HashMap<String, Object> discount = new HashMap<>();
discount.put("percentage", 10);
discount.put("date", "2020-04-25");
discounts.add(discount);
List<Boleto> boletos = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 400000);
data.put("due", "2020-05-20");
data.put("name", "Iron Bank S.A.");
data.put("taxId", "20.018.183/0001-80");
data.put("streetLine1", "Av. Faria Lima, 1844");
data.put("streetLine2", "CJ 13");
data.put("district", "Itaim Bibi");
data.put("city", "São Paulo");
data.put("stateCode", "SP");
data.put("zipCode", "01500-000");
data.put("tags", new String[]{"war supply", "invoice #1234"});
data.put("discounts", discounts);
boletos.add(new Boleto(data));
boletos = Boleto.create(boletos);
for (Boleto boleto : boletos){
System.out.println(boleto);
}
require('starkbank')
boletos = StarkBank::Boleto.create([
StarkBank::Boleto.new(
amount: 400000,
due: '2020-05-20',
name: 'Iron Bank S.A.',
tax_id: '20.018.183/0001-80',
street_line_1: 'Av. Faria Lima, 1844',
street_line_2: 'CJ 13',
district: 'Itaim Bibi',
city: 'São Paulo',
state_code: 'SP',
zip_code: '01500-000',
tags: ['war supply', 'invoice #1234'],
discounts: [
{ percentage: 10, date: '2020-04-25' }
]
)
])
boletos.each do |boleto|
puts boleto
end
boletos = StarkBank.Boleto.create!(
[
%StarkBank.Boleto{
amount: 400000,
due: "2020-05-20",
name: "Iron Bank S.A.",
tax_id: "20.018.183/0001-80",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
state_code: "SP",
zip_code: "01500-000",
tags: ["war supply", "invoice #1234"],
discounts: [
%{percentage: 10, date: "2020-04-25"}
]
}
]
) |> IO.inspect
using System;
using System.Collections.Generic;
List<StarkBank.Boleto> boletos = StarkBank.Boleto.Create(
new List<StarkBank.Boleto>() {
new StarkBank.Boleto(
amount: 400000,
due: new DateTime(2020, 05, 20),
name: "Iron Bank S.A.",
taxID: "20.018.183/0001-80",
streetLine1: "Av. Faria Lima, 1844",
streetLine2: "CJ 13",
district: "Itaim Bibi",
city: "São Paulo",
stateCode: "SP",
zipCode: "01500-000",
tags: new List<string> { "war supply", "invoice #1234" },
discounts: new List<Dictionary<string, object>> {
new Dictionary<string, object> {
{"percentage", 10},
{"date", new DateTime(2020, 04, 25)}
}
}
)
}
);
foreach(StarkBank.Boleto boleto in boletos)
{
Console.WriteLine(boleto);
}
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
"time"
)
func main() {
due := time.Date(2020, 05, 20, 0, 0, 0, 0, time.UTC)
boletos, err := boleto.Create(
[]boleto.Boleto{
{
Amount: 400000,
Due: &due,
Name: "Iron Bank S.A.",
TaxId: "20.018.183/0001-80",
StreetLine1: "Av. Faria Lima, 1844",
StreetLine2: "CJ 13",
District: "Itaim Bibi",
City: "São Paulo",
StateCode: "SP",
ZipCode: "01500-000",
Tags: []string{"war supply", "invoice #1234"},
Discounts: []boleto.Discount{
{Percentage: 10, Date: "2020-04-25"},
},
},
}, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, boleto := range boletos {
fmt.Printf("%+v", boleto)
}
}
(def boletos (starkbank.boleto/create
[{
:amount 400000
:due "2020-05-20"
:name "Iron Bank S.A."
:tax-id "20.018.183/0001-80"
:street-line-1 "Av. Faria Lima, 1844"
:street-line-2 "CJ 13"
:district "Itaim Bibi"
:city "São Paulo"
:state-code "SP"
:zip-code "01500-000"
:tags ["war supply" "invoice #1234"]
:discounts [{:percentage 10 :date "2020-04-25"}]
}]))
(doseq [boleto boletos]
(println boleto))
curl --location --request POST '{{baseUrl}}/v2/boleto'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
--header 'Content-Type: application/json'
--data-raw '{
"boletos": [
{
"amount": 400000,
"due": "2020-05-20",
"name": "Iron Bank S.A.",
"taxId": "20.018.183/0001-80",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"district": "Itaim Bibi",
"city": "São Paulo",
"stateCode": "SP",
"zipCode": "01500-000",
"tags": ["war supply", "invoice #1234"],
"discounts": [
{
"percentage": 10,
"date": "2020-04-25"
}
]
}
]
}'
Boleto(
id=6655767935451136,
amount=400000,
bar_code=34191826100004000001091007175647307144464000,
city=São Paulo,
created=2020-04-23 23:36:08.129614,
descriptions=[],
discounts=[{"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}],
district=Itaim Bibi,
due=2020-05-21,
fee=0,
fine=2.5,
interest=1.3,
line=34191.09107 07175.647309 71444.640008 1 82610000400000,
name=Iron Bank S.A.,
our_number=10445145,
overdue_limit=5,
receiver_name=Winterfell S. A.,
receiver_tax_id=71.735.814/0001-12,
state_code=SP,
status=created,
street_line_1=Av. Faria Lima, 1844,
street_line_2=CJ 13,
tags=["war supply", "invoice #1234"],
tax_id=20.018.183/0001-80,
transaction_ids=[],
zip_code=01500-000,
workspace_id=5083989094170624
)
Boleto {
id: '6655767935451136',
amount: 400000,
barCode: '34191826100004000001091007175647307144464000',
city: 'São Paulo',
created: '2020-04-23T23:36:08.129614+00:00',
descriptions: [],
discounts: [{ percentage: 10.0, date: '2020-04-26T02:59:59.999999+00:00' }],
district: 'Itaim Bibi',
due: '2020-05-21T02:59:59.999999+00:00',
fee: 0,
fine: 2.5,
interest: 1.3,
line: '34191.09107 07175.647309 71444.640008 1 82610000400000',
name: 'Iron Bank S.A.',
ourNumber: '10445145',
overdueLimit: 5,
receiverName: 'Winterfell S. A.',
receiverTaxId: '71.735.814/0001-12',
stateCode: 'SP',
status: 'created',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
tags: ['war supply', 'invoice #1234'],
taxId: '20.018.183/0001-80',
transactionIds: [],
zipCode: '01500-000',
workspaceId: '5083989094170624'
}
StarkBank\Boleto Object
(
[id] => 6655767935451136
[amount] => 400000
[barCode] => 34191826100004000001091007175647307144464000
[city] => São Paulo
[created] => DateTime Object
(
[date] => 2020-04-23 23:36:08.129614
[timezone_type] => 1
[timezone] => +00:00
)
[descriptions] => Array
(
)
[discounts] => Array
(
[0] => Array
(
[percentage] => 10
[date] => 2020-04-25
)
)
[district] => Itaim Bibi
[due] => DateTime Object
(
[date] => 2020-05-21 02:59:59.999999
[timezone_type] => 1
[timezone] => +00:00
)
[fee] => 0
[fine] => 2.5
[interest] => 1.3
[line] => 34191.09107 07175.647309 71444.640008 1 82610000400000
[name] => Iron Bank S.A.
[ourNumber] => 10445145
[overdueLimit] => 5
[receiverName] => Winterfell S. A.
[receiverTaxId] => 71.735.814/0001-12
[stateCode] => SP
[status] => created
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => CJ 13
[tags] => Array
(
[0] => war supply
[1] => invoice #1234
)
[taxId] => 20.018.183/0001-80
[transactionIds] => Array
(
)
[zipCode] => 01500-000
[workspaceId] => 5083989094170624
)
Boleto({
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [{"percentage": 10.0, "date": "2020-04-26T02:59:59.999999+00:00"}],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
})
boleto(
id: 6655767935451136,
amount: 400000,
bar_code: 34191826100004000001091007175647307144464000,
city: São Paulo,
created: 2020-04-23T23:36:08+00:00,
descriptions: [],
discounts: [{ percentage: 10.0, date: 2020-04-26T02:59:59+00:00 }],
district: Itaim Bibi,
due: 2020-05-21T02:59:59+00:00,
fee: 0,
fine: 2.5,
interest: 1.3,
line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
name: Iron Bank S.A.,
our_number: 10445145,
overdue_limit: 5,
receiver_name: Winterfell S. A.,
receiver_tax_id: 71.735.814/0001-12,
state_code: SP,
status: created,
street_line_1: Av. Faria Lima, 1844,
street_line_2: CJ 13,
tags: ["war supply", "invoice #1234"],
tax_id: 20.018.183/0001-80,
transaction_ids: [],
zip_code: 01500-000,
workspace_id: 5083989094170624
)
%StarkBank.Boleto{
amount: 400000,
bar_code: "34191826100004000001091007175647307144464000",
city: "São Paulo",
created: ~U[2020-04-23 23:36:08.129614Z],
descriptions: [],
discounts: [%{date: "2020-04-26T02:59:59.999999+00:00", percentage: 10.0}],
district: "Itaim Bibi",
due: ~U[2020-05-21 02:59:59.999999Z],
fee: 0,
fine: 2.5,
id: "6655767935451136",
interest: 1.3,
line: "34191.09107 07175.647309 71444.640008 1 82610000400000",
name: "Iron Bank S.A.",
our_number: "10445145",
overdue_limit: 5,
receiver_name: "Winterfell S. A.",
receiver_tax_id: "71.735.814/0001-12",
state_code: "SP",
status: "created",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
tags: ["war supply", "invoice #1234"],
tax_id: "20.018.183/0001-80",
transaction_ids: [],
zip_code: "01500-000",
workspace_id: "5083989094170624"
}
Boleto(
Amount: 400000,
BarCode: 34191826100004000001091007175647307144464000,
City: São Paulo,
Created: 04/23/2020 23:36:08,
Descriptions: { },
Discounts: { { percentage: 10, date: 04/25/2020 } },
District: Itaim Bibi,
Due: 05/21/2020 02:59:59,
Fee: 0,
Fine: 2.5,
ID: 6655767935451136,
Interest: 1.3,
Line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
Name: Iron Bank S.A.,
OurNumber: 10445145,
OverdueLimit: 5,
ReceiverName: Winterfell S. A.,
ReceiverTaxId: 71.735.814/0001-12,
StateCode: SP,
Status: created,
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: CJ 13,
Tags: { war supply, invoice #1234 },
TaxId: 20.018.183/0001-80,
TransactionIds: { },
ZipCode: 01500-000,
WorkspaceId: 5083989094170624
)
{
Id:6655767935451136
Amount:400000
BarCode:34191826100004000001091007175647307144464000
City:São Paulo
Created:2020-04-23 23:36:08.129614 +0000 +0000
Descriptions:[]
Discounts:[{Percentage:10 Date:2020-04-25}]
District:Itaim Bibi
Due:2020-05-21 02:59:59.999999 +0000 +0000
Fee:0
Fine:2.5
Interest:1.3
Line:34191.09107 07175.647309 71444.640008 1 82610000400000
Name:Iron Bank S.A.
OurNumber:10445145
OverdueLimit:5
ReceiverName:Winterfell S. A.
ReceiverTaxId:71.735.814/0001-12
StateCode:SP
Status:created
StreetLine1:Av. Faria Lima, 1844
StreetLine2:CJ 13
Tags:[war supply invoice #1234]
TaxId:20.018.183/0001-80
TransactionIds:[]
ZipCode:01500-000
WorkspaceId:5083989094170624
}
{
:id 6655767935451136,
:amount 400000,
:bar-code 34191826100004000001091007175647307144464000,
:city São Paulo,
:created 2020-04-23T23:36:08.129614+00:00,
:descriptions [],
:discounts [{:percentage 10.0 :date 2020-04-26T02:59:59.999999+00:00}],
:district Itaim Bibi,
:due 2020-05-21T02:59:59.999999+00:00,
:fee 0,
:fine 2.5,
:interest 1.3,
:line 34191.09107 07175.647309 71444.640008 1 82610000400000,
:name Iron Bank S.A.,
:our-number 10445145,
:overdue-limit 5,
:receiver-name Winterfell S. A.,
:receiver-tax-id 71.735.814/0001-12,
:state-code SP,
:status created,
:street-line-1 Av. Faria Lima, 1844,
:street-line-2 CJ 13,
:tags [war supply invoice #1234],
:tax-id 20.018.183/0001-80,
:transaction-ids [],
:zip-code 01500-000,
:workspace-id 5083989094170624
}
{
"message": "Boleto(s) successfully created",
"boletos": [
{
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [
{
"percentage": 10.0,
"date": "2020-04-25"
}
],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
]
}
You can download a Boleto as a PDF file using its ID. This is useful for sending the payment slip to your customer by email or displaying it on your website.
import starkbank
pdf = starkbank.boleto.pdf("6655767935451136")
with open("boleto.pdf", "wb") as file:
file.write(pdf)
const starkbank = require('starkbank');
const fs = require('fs').promises;
(async() => {
let pdf = await starkbank.boleto.pdf('6655767935451136');
await fs.writeFile('boleto.pdf', pdf);
})();
use StarkBank\Boleto;
$pdf = Boleto::pdf("6655767935451136");
$fp = fopen('boleto.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
import com.starkbank.*;
import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
InputStream pdf = Boleto.pdf("6655767935451136");
java.nio.file.Files.copy(
pdf,
new File("boleto.pdf").toPath(),
StandardCopyOption.REPLACE_EXISTING
);
require('starkbank')
pdf = StarkBank::Boleto.pdf('6655767935451136')
File.binwrite('boleto.pdf', pdf)
pdf = StarkBank.Boleto.pdf!("6655767935451136")
File.write!("boleto.pdf", pdf)
using System;
byte[] pdf = StarkBank.Boleto.Pdf("6655767935451136");
System.IO.File.WriteAllBytes("boleto.pdf", pdf);
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
"os"
)
func main() {
pdf, err := boleto.Pdf("6655767935451136", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
os.WriteFile("boleto.pdf", pdf, 0666)
}
(def pdf (starkbank.boleto/pdf "6655767935451136"))
(clojure.java.io/copy pdf (clojure.java.io/file "boleto.pdf"))
curl --location --request GET '{{baseUrl}}/v2/boleto/6655767935451136/pdf'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
You can list all Boletos that match your filters. Use the after and before parameters to filter by creation date.
import starkbank
boletos = starkbank.boleto.query(
after="2020-04-01",
before="2020-05-01",
limit=1
)
for boleto in boletos:
print(boleto)
const starkbank = require('starkbank');
(async() => {
let boletos = await starkbank.boleto.query({
after: '2020-04-01',
before: '2020-05-01',
limit: 1
});
for await (let boleto of boletos) {
console.log(boleto);
}
})();
use StarkBank\Boleto;
$boletos = Boleto::query([
"after" => "2020-04-01",
"before" => "2020-05-01",
"limit" => 1
]);
foreach($boletos as $boleto){
print_r($boleto);
}
import com.starkbank.*;
import java.util.HashMap;
HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-05-01");
params.put("limit", 1);
Generator<Boleto> boletos = Boleto.query(params);
for (Boleto boleto : boletos){
System.out.println(boleto);
}
require('starkbank')
boletos = StarkBank::Boleto.query(
after: '2020-04-01',
before: '2020-05-01',
limit: 1
)
boletos.each do |boleto|
puts boleto
end
boletos = StarkBank.Boleto.query!(
after: "2020-04-01",
before: "2020-05-01",
limit: 1
) |> Enum.take(1) |> IO.inspect
using System;
using System.Collections.Generic;
IEnumerable<StarkBank.Boleto> boletos = StarkBank.Boleto.Query(
after: new DateTime(2020, 4, 1),
before: new DateTime(2020, 5, 1),
limit: 1
);
foreach(StarkBank.Boleto boleto in boletos)
{
Console.WriteLine(boleto);
}
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
)
func main() {
var params = map[string]interface{}{}
params["after"] = "2020-04-01"
params["before"] = "2020-05-01"
params["limit"] = 1
boletos := boleto.Query(params, nil)
for boleto := range boletos {
fmt.Printf("%+v", boleto)
}
}
(def boletos (starkbank.boleto/query
{
:after "2020-04-01"
:before "2020-05-01"
:limit 1
}))
(doseq [boleto boletos]
(println boleto))
curl --location --request GET '{{baseUrl}}/v2/boleto?after=2020-04-01&before=2020-05-01&limit=1'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
Boleto(
id=6655767935451136,
amount=400000,
bar_code=34191826100004000001091007175647307144464000,
city=São Paulo,
created=2020-04-23 23:36:08.129614,
descriptions=[],
discounts=[],
district=Itaim Bibi,
due=2020-05-21,
fee=0,
fine=2.5,
interest=1.3,
line=34191.09107 07175.647309 71444.640008 1 82610000400000,
name=Iron Bank S.A.,
our_number=10445145,
overdue_limit=5,
receiver_name=Winterfell S. A.,
receiver_tax_id=71.735.814/0001-12,
state_code=SP,
status=created,
street_line_1=Av. Faria Lima, 1844,
street_line_2=CJ 13,
tags=["war supply", "invoice #1234"],
tax_id=20.018.183/0001-80,
transaction_ids=[],
zip_code=01500-000,
workspace_id=5083989094170624
)
Boleto {
id: '6655767935451136',
amount: 400000,
barCode: '34191826100004000001091007175647307144464000',
city: 'São Paulo',
created: '2020-04-23T23:36:08.129614+00:00',
descriptions: [],
discounts: [],
district: 'Itaim Bibi',
due: '2020-05-21T02:59:59.999999+00:00',
fee: 0,
fine: 2.5,
interest: 1.3,
line: '34191.09107 07175.647309 71444.640008 1 82610000400000',
name: 'Iron Bank S.A.',
ourNumber: '10445145',
overdueLimit: 5,
receiverName: 'Winterfell S. A.',
receiverTaxId: '71.735.814/0001-12',
stateCode: 'SP',
status: 'created',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
tags: ['war supply', 'invoice #1234'],
taxId: '20.018.183/0001-80',
transactionIds: [],
zipCode: '01500-000',
workspaceId: '5083989094170624'
}
StarkBank\Boleto Object
(
[id] => 6655767935451136
[amount] => 400000
[barCode] => 34191826100004000001091007175647307144464000
[city] => São Paulo
[created] => DateTime Object
(
[date] => 2020-04-23 23:36:08.129614
[timezone_type] => 1
[timezone] => +00:00
)
[descriptions] => Array
(
)
[discounts] => Array
(
)
[district] => Itaim Bibi
[due] => DateTime Object
(
[date] => 2020-05-21 02:59:59.999999
[timezone_type] => 1
[timezone] => +00:00
)
[fee] => 0
[fine] => 2.5
[interest] => 1.3
[line] => 34191.09107 07175.647309 71444.640008 1 82610000400000
[name] => Iron Bank S.A.
[ourNumber] => 10445145
[overdueLimit] => 5
[receiverName] => Winterfell S. A.
[receiverTaxId] => 71.735.814/0001-12
[stateCode] => SP
[status] => created
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => CJ 13
[tags] => Array
(
[0] => war supply
[1] => invoice #1234
)
[taxId] => 20.018.183/0001-80
[transactionIds] => Array
(
)
[zipCode] => 01500-000
[workspaceId] => 5083989094170624
)
Boleto({
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
})
boleto(
id: 6655767935451136,
amount: 400000,
bar_code: 34191826100004000001091007175647307144464000,
city: São Paulo,
created: 2020-04-23T23:36:08+00:00,
descriptions: [],
discounts: [],
district: Itaim Bibi,
due: 2020-05-21T02:59:59+00:00,
fee: 0,
fine: 2.5,
interest: 1.3,
line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
name: Iron Bank S.A.,
our_number: 10445145,
overdue_limit: 5,
receiver_name: Winterfell S. A.,
receiver_tax_id: 71.735.814/0001-12,
state_code: SP,
status: created,
street_line_1: Av. Faria Lima, 1844,
street_line_2: CJ 13,
tags: ["war supply", "invoice #1234"],
tax_id: 20.018.183/0001-80,
transaction_ids: [],
zip_code: 01500-000,
workspace_id: 5083989094170624
)
%StarkBank.Boleto{
amount: 400000,
bar_code: "34191826100004000001091007175647307144464000",
city: "São Paulo",
created: ~U[2020-04-23 23:36:08.129614Z],
descriptions: [],
discounts: [],
district: "Itaim Bibi",
due: ~U[2020-05-21 02:59:59.999999Z],
fee: 0,
fine: 2.5,
id: "6655767935451136",
interest: 1.3,
line: "34191.09107 07175.647309 71444.640008 1 82610000400000",
name: "Iron Bank S.A.",
our_number: "10445145",
overdue_limit: 5,
receiver_name: "Winterfell S. A.",
receiver_tax_id: "71.735.814/0001-12",
state_code: "SP",
status: "created",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
tags: ["war supply", "invoice #1234"],
tax_id: "20.018.183/0001-80",
transaction_ids: [],
zip_code: "01500-000",
workspace_id: "5083989094170624"
}
Boleto(
Amount: 400000,
BarCode: 34191826100004000001091007175647307144464000,
City: São Paulo,
Created: 04/23/2020 23:36:08,
Descriptions: { },
Discounts: { },
District: Itaim Bibi,
Due: 05/21/2020 02:59:59,
Fee: 0,
Fine: 2.5,
ID: 6655767935451136,
Interest: 1.3,
Line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
Name: Iron Bank S.A.,
OurNumber: 10445145,
OverdueLimit: 5,
ReceiverName: Winterfell S. A.,
ReceiverTaxId: 71.735.814/0001-12,
StateCode: SP,
Status: created,
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: CJ 13,
Tags: { war supply, invoice #1234 },
TaxId: 20.018.183/0001-80,
TransactionIds: { },
ZipCode: 01500-000,
WorkspaceId: 5083989094170624
)
{
Id:6655767935451136
Amount:400000
BarCode:34191826100004000001091007175647307144464000
City:São Paulo
Created:2020-04-23 23:36:08.129614 +0000 +0000
Descriptions:[]
Discounts:[]
District:Itaim Bibi
Due:2020-05-21 02:59:59.999999 +0000 +0000
Fee:0
Fine:2.5
Interest:1.3
Line:34191.09107 07175.647309 71444.640008 1 82610000400000
Name:Iron Bank S.A.
OurNumber:10445145
OverdueLimit:5
ReceiverName:Winterfell S. A.
ReceiverTaxId:71.735.814/0001-12
StateCode:SP
Status:created
StreetLine1:Av. Faria Lima, 1844
StreetLine2:CJ 13
Tags:[war supply invoice #1234]
TaxId:20.018.183/0001-80
TransactionIds:[]
ZipCode:01500-000
WorkspaceId:5083989094170624
}
{
:id 6655767935451136,
:amount 400000,
:bar-code 34191826100004000001091007175647307144464000,
:city São Paulo,
:created 2020-04-23T23:36:08.129614+00:00,
:descriptions [],
:discounts [],
:district Itaim Bibi,
:due 2020-05-21T02:59:59.999999+00:00,
:fee 0,
:fine 2.5,
:interest 1.3,
:line 34191.09107 07175.647309 71444.640008 1 82610000400000,
:name Iron Bank S.A.,
:our-number 10445145,
:overdue-limit 5,
:receiver-name Winterfell S. A.,
:receiver-tax-id 71.735.814/0001-12,
:state-code SP,
:status created,
:street-line-1 Av. Faria Lima, 1844,
:street-line-2 CJ 13,
:tags [war supply invoice #1234],
:tax-id 20.018.183/0001-80,
:transaction-ids [],
:zip-code 01500-000,
:workspace-id 5083989094170624
}
{
"cursor": null,
"boletos": [
{
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "created",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
]
}
You can cancel a Boleto by its ID. This sends a cancellation request to CIP. Once canceled, the Boleto can no longer be paid.
import starkbank
boleto = starkbank.boleto.delete("6655767935451136")
print(boleto)
const starkbank = require('starkbank');
(async() => {
let boleto = await starkbank.boleto.delete('6655767935451136');
console.log(boleto);
})();
use StarkBank\Boleto;
$boleto = Boleto::delete("6655767935451136");
print_r($boleto);
import com.starkbank.*;
Boleto boleto = Boleto.delete("6655767935451136");
System.out.println(boleto);
require('starkbank')
boleto = StarkBank::Boleto.delete('6655767935451136')
puts boleto
boleto = StarkBank.Boleto.delete!("6655767935451136") |> IO.inspect
using System;
StarkBank.Boleto boleto = StarkBank.Boleto.Delete("6655767935451136");
Console.WriteLine(boleto);
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boleto"
)
func main() {
deletedBoleto, err := boleto.Delete("6655767935451136", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", deletedBoleto)
}
(def boleto (starkbank.boleto/delete "6655767935451136"))
(println boleto)
curl --location --request DELETE '{{baseUrl}}/v2/boleto/6655767935451136'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
Boleto(
id=6655767935451136,
amount=400000,
bar_code=34191826100004000001091007175647307144464000,
city=São Paulo,
created=2020-04-23 23:36:08.129614,
descriptions=[],
discounts=[],
district=Itaim Bibi,
due=2020-05-21,
fee=0,
fine=2.5,
interest=1.3,
line=34191.09107 07175.647309 71444.640008 1 82610000400000,
name=Iron Bank S.A.,
our_number=10445145,
overdue_limit=5,
receiver_name=Winterfell S. A.,
receiver_tax_id=71.735.814/0001-12,
state_code=SP,
status=canceled,
street_line_1=Av. Faria Lima, 1844,
street_line_2=CJ 13,
tags=["war supply", "invoice #1234"],
tax_id=20.018.183/0001-80,
transaction_ids=[],
zip_code=01500-000,
workspace_id=5083989094170624
)
Boleto {
id: '6655767935451136',
amount: 400000,
barCode: '34191826100004000001091007175647307144464000',
city: 'São Paulo',
created: '2020-04-23T23:36:08.129614+00:00',
descriptions: [],
discounts: [],
district: 'Itaim Bibi',
due: '2020-05-21T02:59:59.999999+00:00',
fee: 0,
fine: 2.5,
interest: 1.3,
line: '34191.09107 07175.647309 71444.640008 1 82610000400000',
name: 'Iron Bank S.A.',
ourNumber: '10445145',
overdueLimit: 5,
receiverName: 'Winterfell S. A.',
receiverTaxId: '71.735.814/0001-12',
stateCode: 'SP',
status: 'canceled',
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: 'CJ 13',
tags: ['war supply', 'invoice #1234'],
taxId: '20.018.183/0001-80',
transactionIds: [],
zipCode: '01500-000',
workspaceId: '5083989094170624'
}
StarkBank\Boleto Object
(
[id] => 6655767935451136
[amount] => 400000
[barCode] => 34191826100004000001091007175647307144464000
[city] => São Paulo
[created] => DateTime Object
(
[date] => 2020-04-23 23:36:08.129614
[timezone_type] => 1
[timezone] => +00:00
)
[descriptions] => Array
(
)
[discounts] => Array
(
)
[district] => Itaim Bibi
[due] => DateTime Object
(
[date] => 2020-05-21 02:59:59.999999
[timezone_type] => 1
[timezone] => +00:00
)
[fee] => 0
[fine] => 2.5
[interest] => 1.3
[line] => 34191.09107 07175.647309 71444.640008 1 82610000400000
[name] => Iron Bank S.A.
[ourNumber] => 10445145
[overdueLimit] => 5
[receiverName] => Winterfell S. A.
[receiverTaxId] => 71.735.814/0001-12
[stateCode] => SP
[status] => canceled
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => CJ 13
[tags] => Array
(
[0] => war supply
[1] => invoice #1234
)
[taxId] => 20.018.183/0001-80
[transactionIds] => Array
(
)
[zipCode] => 01500-000
[workspaceId] => 5083989094170624
)
Boleto({
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "canceled",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
})
boleto(
id: 6655767935451136,
amount: 400000,
bar_code: 34191826100004000001091007175647307144464000,
city: São Paulo,
created: 2020-04-23T23:36:08+00:00,
descriptions: [],
discounts: [],
district: Itaim Bibi,
due: 2020-05-21T02:59:59+00:00,
fee: 0,
fine: 2.5,
interest: 1.3,
line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
name: Iron Bank S.A.,
our_number: 10445145,
overdue_limit: 5,
receiver_name: Winterfell S. A.,
receiver_tax_id: 71.735.814/0001-12,
state_code: SP,
status: canceled,
street_line_1: Av. Faria Lima, 1844,
street_line_2: CJ 13,
tags: ["war supply", "invoice #1234"],
tax_id: 20.018.183/0001-80,
transaction_ids: [],
zip_code: 01500-000,
workspace_id: 5083989094170624
)
%StarkBank.Boleto{
amount: 400000,
bar_code: "34191826100004000001091007175647307144464000",
city: "São Paulo",
created: ~U[2020-04-23 23:36:08.129614Z],
descriptions: [],
discounts: [],
district: "Itaim Bibi",
due: ~U[2020-05-21 02:59:59.999999Z],
fee: 0,
fine: 2.5,
id: "6655767935451136",
interest: 1.3,
line: "34191.09107 07175.647309 71444.640008 1 82610000400000",
name: "Iron Bank S.A.",
our_number: "10445145",
overdue_limit: 5,
receiver_name: "Winterfell S. A.",
receiver_tax_id: "71.735.814/0001-12",
state_code: "SP",
status: "canceled",
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "CJ 13",
tags: ["war supply", "invoice #1234"],
tax_id: "20.018.183/0001-80",
transaction_ids: [],
zip_code: "01500-000",
workspace_id: "5083989094170624"
}
Boleto(
Amount: 400000,
BarCode: 34191826100004000001091007175647307144464000,
City: São Paulo,
Created: 04/23/2020 23:36:08,
Descriptions: { },
Discounts: { },
District: Itaim Bibi,
Due: 05/21/2020 02:59:59,
Fee: 0,
Fine: 2.5,
ID: 6655767935451136,
Interest: 1.3,
Line: 34191.09107 07175.647309 71444.640008 1 82610000400000,
Name: Iron Bank S.A.,
OurNumber: 10445145,
OverdueLimit: 5,
ReceiverName: Winterfell S. A.,
ReceiverTaxId: 71.735.814/0001-12,
StateCode: SP,
Status: canceled,
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: CJ 13,
Tags: { war supply, invoice #1234 },
TaxId: 20.018.183/0001-80,
TransactionIds: { },
ZipCode: 01500-000,
WorkspaceId: 5083989094170624
)
{
Id:6655767935451136
Amount:400000
BarCode:34191826100004000001091007175647307144464000
City:São Paulo
Created:2020-04-23 23:36:08.129614 +0000 +0000
Descriptions:[]
Discounts:[]
District:Itaim Bibi
Due:2020-05-21 02:59:59.999999 +0000 +0000
Fee:0
Fine:2.5
Interest:1.3
Line:34191.09107 07175.647309 71444.640008 1 82610000400000
Name:Iron Bank S.A.
OurNumber:10445145
OverdueLimit:5
ReceiverName:Winterfell S. A.
ReceiverTaxId:71.735.814/0001-12
StateCode:SP
Status:canceled
StreetLine1:Av. Faria Lima, 1844
StreetLine2:CJ 13
Tags:[war supply invoice #1234]
TaxId:20.018.183/0001-80
TransactionIds:[]
ZipCode:01500-000
WorkspaceId:5083989094170624
}
{
:id 6655767935451136,
:amount 400000,
:bar-code 34191826100004000001091007175647307144464000,
:city São Paulo,
:created 2020-04-23T23:36:08.129614+00:00,
:descriptions [],
:discounts [],
:district Itaim Bibi,
:due 2020-05-21T02:59:59.999999+00:00,
:fee 0,
:fine 2.5,
:interest 1.3,
:line 34191.09107 07175.647309 71444.640008 1 82610000400000,
:name Iron Bank S.A.,
:our-number 10445145,
:overdue-limit 5,
:receiver-name Winterfell S. A.,
:receiver-tax-id 71.735.814/0001-12,
:state-code SP,
:status canceled,
:street-line-1 Av. Faria Lima, 1844,
:street-line-2 CJ 13,
:tags [war supply invoice #1234],
:tax-id 20.018.183/0001-80,
:transaction-ids [],
:zip-code 01500-000,
:workspace-id 5083989094170624
}
{
"message": "Boleto successfully deleted",
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2020-04-23T23:36:08.129614+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2020-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "canceled",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": ["war supply", "invoice #1234"],
"taxId": "20.018.183/0001-80",
"transactionIds": [],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
After creation, you can use asynchronous Webhooks to monitor status changes of the entity. The Boleto will follow the following life cycle:
Every time we change a Boleto, we create a Log. Logs are pretty useful for understanding the life cycle of each Boleto. Whenever a new Log is created, we will fire a Webhook to your registered URL.
NOTE: Check the Webhook Get Started for more details on how to receive and process Webhook events.
NOTE: A boleto subscription is required to receive this event.
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
{
"event": {
"id": "5765896384749568",
"subscription": "boleto",
"workspaceId": "5083989094170624",
"created": "2024-02-15T14:22:31.745612+00:00",
"log": {
"id": "4839056728391680",
"type": "paid",
"created": "2024-02-15T14:22:31.102847+00:00",
"errors": [],
"boleto": {
"id": "6655767935451136",
"amount": 400000,
"barCode": "34191826100004000001091007175647307144464000",
"city": "São Paulo",
"created": "2024-01-31T21:15:16.701209+00:00",
"descriptions": [],
"discounts": [],
"district": "Itaim Bibi",
"due": "2024-05-21T02:59:59.999999+00:00",
"fee": 0,
"fine": 2.5,
"interest": 1.3,
"line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
"name": "Iron Bank S.A.",
"ourNumber": "10445145",
"overdueLimit": 5,
"receiverName": "Winterfell S. A.",
"receiverTaxId": "71.735.814/0001-12",
"stateCode": "SP",
"status": "paid",
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "CJ 13",
"tags": [
"customer/123",
"order/567"
],
"taxId": "20.018.183/0001-80",
"transactionIds": ["4839056728391680"],
"zipCode": "01500-000",
"workspaceId": "5083989094170624"
}
}
}
}
Boleto Holmes lets you investigate a Boleto's current status with CIP (the Brazilian payment clearing house) in less than an hour. This is useful when you need faster status updates than the standard notification flow.
Since results are delivered asynchronously, set up a boleto-holmes webhook subscription to receive investigation results.
Create a Boleto Holmes by providing the Boleto ID you want to investigate. The investigation starts with status solving and changes to solved once complete.
After a Holmes is solved, it does not update again. Create a new one if you need a fresh investigation.
import starkbank
holmes = starkbank.boletoholmes.create([
starkbank.BoletoHolmes(
boleto_id="5656565656565656",
tags=["sherlock", "holmes"],
)
])
for holmes in holmes:
print(holmes)
const starkbank = require('starkbank');
(async() => {
let holmes = await starkbank.boletoHolmes.create([
{
boletoId: '5656565656565656',
tags: ['sherlock', 'holmes'],
}
])
for (let holmes of holmes) {
console.log(holmes);
}
})();
use StarkBank\BoletoHolmes;
$holmes = [new BoletoHolmes([
"boletoId" => "5656565656565656",
"tags" => ["sherlock", "holmes"]
])];
$boletoHolmes = BoletoHolmes::create($holmes)[0];
foreach($boletoHolmes as $sherlock){
print_r($sherlock);
}
import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
List<BoletoHolmes> holmes = new ArrayList<>();
HashMap<String, Object> dataHolmes = new HashMap<>();
dataHolmes.put("boletoId", "5656565656565656");
dataHolmes.put("tags", new String[]{"sherlock", "holmes"});
holmes.add(new BoletoHolmes(dataHolmes));
holmes = BoletoHolmes.create(holmes);
for (BoletoHolmes sherlock : holmes){
System.out.println(sherlock);
}
require('starkbank')
holmes = StarkBank::BoletoHolmes.create([
StarkBank::BoletoHolmes.new(
boleto_id: '5656565656565656',
tags: ['sherlock', 'holmes']
)
])
holmes.each do |sherlock|
puts sherlock
end
holmes = StarkBank.BoletoHolmes.create!(
[
%StarkBank.BoletoHolmes{
boleto_id: "5656565656565656",
tags: ["sherlock", "holmes"],
}
]
) |> IO.inspect
using System;
using System.Collections.Generic;
List<StarkBank.BoletoHolmes> holmes = StarkBank.BoletoHolmes.Create(
new List<StarkBank.BoletoHolmes>() {
new BoletoHolmes(
boletoID: "5656565656565656",
tags: new List<string> { "sherlock", "holmes" }
)
}
);
foreach(StarkBank.BoletoHolmes sherlock in holmes)
{
Console.WriteLine(sherlock);
}
package main
import (
"fmt"
"github.com/starkbank/sdk-go/starkbank/boletoholmes"
)
func main() {
holmes, err := boletoholmes.Create(
[]boletoholmes.BoletoHolmes{
{
BoletoId: "4933519247671296",
Tags: []string{"sherlock", "holmes"},
},
}, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, sherlock := range holmes {
fmt.Printf("%+v", sherlock)
}
}
def holmes (starkbank.boleto-holmes/create
[{
:boleto-id "5656565656565656"
:tags ["sherlock" "holmes"]
}]))
(doseq [sherlock holmes]
(println sherlock))
curl --location --request POST '{{baseUrl}}/v2/boleto-holmes'
--header 'Access-Id: {{accessId}}'
--header 'Access-Time: {{accessTime}}'
--header 'Access-Signature: {{accessSignature}}'
--header 'Content-Type: application/json'
--data-raw '{
"holmes": [
{
"boletoId": "5656565656565656",
"tags": ["sherlock", "holmes"],
},
]
}'
BoletoHolmes(
boleto_id=5656565656565656,
created=2020-07-23 00:07:51.069587,
id=3232323232323232,
result=,
status=solving,
tags=["sherlock", "holmes"],
updated=2020-07-23 00:07:51.069597
)
BoletoHolmes {
boletoId: '5656565656565656',
created: '2020-07-23T00:07:40.611174+00:00',
id: '3232323232323232',
result: '',
status: 'solving',
tags: ['sherlock', 'holmes'],
updated: '2020-07-23T00:07:51.611174+00:00'
}
StarkBank\BoletoHolmes Object
(
[id] => 3232323232323232
[boletoId] => 5656565656565656
[tags] => Array
(
[0] => sherlock
[1] => holmes
)
[status] => solving
[result] =>
[created] => DateTime Object
(
[date] => 2020-07-23 00:07:51.532473
[timezone_type] => 1
[timezone] => +00:00
)
[updated] => DateTime Object
(
[date] => 2020-07-23 00:07:51.532473
[timezone_type] => 1
[timezone] => +00:00
)
)
BoletoHolmes({
"tags": [
"sherlock",
"holmes"
],
"boletoId": "5656565656565656",
"status": "solving",
"result": "",
"created": "2020-07-23T00:07:51.176283+00:00",
"updated": "2020-07-23T00:07:51.176290+00:00",
"id": "3232323232323232"
})
boletoholmes(
id: 3232323232323232,
boleto_id: 5656565656565656,
tags: ["sherlock", "holmes"],
status: solving,
result: ,
created: 2020-07-23T00:07:51+00:00,
updated: 2020-07-23T00:07:51+00:00
)
StarkBank.BoletoHolmes{
boleto_id: "5656565656565656",
created: ~U[2020-07-23 00:07:51.256963Z],
id: "3232323232323232",
result: "",
status: "solving",
tags: ["sherlock", "holmes"],
updated: ~U[2020-07-23 00:07:51.256969Z]
}
BoletoHolmes(
BoletoID: '5656565656565656',
Created: 07/23/2020 00:07:51,
ID: 3232323232323232,
Result: ,
Status: solving,
Tags: { sherlock, holmes },
Updated: 07/23/2020 00:07:51,
)
{
Id:3232323232323232
BoletoId:5656565656565656
Tags:[sherlock holmes]
Status:solving
Result:
Created:2020-07-23 00:07:51.351907 +0000 +0000
Updated:2020-07-23 00:07:51.351914 +0000 +0000
}
{
:id 3232323232323232,
:boleto-id 5656565656565656,
:status solving,
:result,
:tags [sherlock holmes],
:created 2020-07-23T00:07:51.467925+00:00,
:updated 2020-07-23T00:07:51.467931+00:00
}
{
"message": "Boleto Holmes successfully created",
"holmes": [
{
"boletoId": "5656565656565656",
"created": "2020-07-23T00:07:51.611174+00:00",
"id": "3232323232323232",
"result": "",
"status": "solving",
"tags": ["sherlock", "holmes"],
"updated": "2020-07-23T00:07:51.611174+00:00"
}
]
}