Overview

Setup

Sandbox

Boleto

Boleto Overview

The Boleto Object

Creating a Boleto

Setting Due Date, Fine, and Interest

Setting Receiver Name and Tax ID

Adding Discounts, Descriptions, and Tags

Getting a Boleto PDF

Listing Boletos

Canceling a Boleto

Receiving Boleto Webhook

Boleto Holmes

Boleto Holmes Overview

Creating a Boleto Holmes

Boleto

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.

RESOURCE SUMMARY
The payment slip you generate to charge your customer.
Investigates Boleto status updates in less than an hour.

Setup

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

Sandbox

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:

Create a Workspace in Sandbox

Boleto Overview

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.

The Boleto Status

Each Boleto has a status that can change over time according to its life cycle:

boleto-status

StatusDescription
CreatedThe Boleto was successfully created and is waiting to be registered.
RegisteredThe Boleto was registered with CIP and can now be paid.
OverdueThe Boleto has passed its due date and may now incur fines and interest.
PaidThe Boleto was paid by the payer.
CanceledThe Boleto was canceled and can no longer be paid.
FailedThe Boleto registration with CIP failed.

The Boleto Logs

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:

boleto-log

Log typeStatusDescription
CreatedCreatedThe Boleto was successfully created in Stark Bank.
RegisteredRegisteredThe Boleto was registered with CIP and is ready to be paid.
FailedFailedThe Boleto registration with CIP failed.
OverdueOverdueThe Boleto has passed its due date.
PaidPaidThe Boleto was paid by the payer.
CreditedPaidThe Boleto payment was credited to your account.
CancelingCanceledThe Boleto is being canceled at CIP.
CanceledCanceledThe Boleto was successfully canceled.

The Boleto Object

Attributes

id STRING

Unique id for the boleto.

amount INTEGER

Amount in cents to be charged. Example: 100 (R$1.00).

barCode STRING

Boleto bar code.

city STRING

Customer city name.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

descriptions LIST OF OBJECTS

List of description objects.

discounts LIST OF OBJECTS

List of discount objects.

district STRING

Customer district name.

due STRING

Due date of the boleto. Example: "2020-04-23".

fee INTEGER

Fee charged in cents.

fine FLOAT

Percentage charged if paid after due date.

interest FLOAT

Monthly percentage charged if paid after due date.

line STRING

Boleto line number.

name STRING

Customer full name.

ourNumber STRING

Boleto control number (nosso numero).

overdueLimit INTEGER

Number of days after due date until boleto expires.

receiverName STRING

Name of the credit receiver (Sacador Avalista).

receiverTaxId STRING

Tax ID of the credit receiver.

stateCode STRING

Customer state code.

status STRING

Current boleto status. Options: "created", "overdue", "paid", "canceled".

streetLine1 STRING

Customer street address.

streetLine2 STRING

Customer street address complement.

tags LIST OF STRINGS

Tags associated with the boleto.

taxId STRING

Customer CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the boleto.

workspaceId STRING

ID of the workspace that created the boleto.

zipCode STRING

Customer zip code.

Creating a Boleto

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.

Python

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)
    

Javascript

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);
    }
})();
    

PHP

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);
}
    

Java

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);
}
    

Ruby

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
    

Elixir

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
    

C#

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);
}
    

Go

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)
    }
}
    

Clojure

(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

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"]
        }
    ]
}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

%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"
}
    

C#

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
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
        }
    ]
}
    

Setting Due Date, Fine, and Interest

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).

Python

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)
    

Javascript

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);
    }
})();
    

PHP

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);
}
    

Java

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);
}
    

Ruby

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
    

Elixir

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
    

C#

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);
}
    

Go

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)
    }
}
    

Clojure

(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

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"]
        }
    ]
}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

%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"
}
    

C#

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
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
        }
    ]
}
    

Setting Receiver Name and Tax ID

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.

Python

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)
    

Javascript

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);
    }
})();
    

PHP

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);
}
    

Java

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);
}
    

Ruby

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
    

Elixir

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
    

C#

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);
}
    

Go

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)
    }
}
    

Clojure

(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

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"]
        }
    ]
}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

%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"
}
    

C#

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
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
        }
    ]
}
    

Adding Discounts, Descriptions, and Tags

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.

Python

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)
    

Javascript

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);
    }
})();
    

PHP

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);
}
    

Java

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);
}
    

Ruby

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
    

Elixir

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
    

C#

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);
}
    

Go

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)
    }
}
    

Clojure

(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

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"
                }
            ]
        }
    ]
}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

%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"
}
    

C#

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
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
        }
    ]
}
    

Getting a Boleto PDF

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.

Python

import starkbank

pdf = starkbank.boleto.pdf("6655767935451136")

with open("boleto.pdf", "wb") as file:
    file.write(pdf)
    

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.boleto.pdf('6655767935451136');
    await fs.writeFile('boleto.pdf', pdf);
})();
    

PHP

use StarkBank\Boleto;

$pdf = Boleto::pdf("6655767935451136");

$fp = fopen('boleto.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
    

Java

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
);
    

Ruby

require('starkbank')

pdf = StarkBank::Boleto.pdf('6655767935451136')

File.binwrite('boleto.pdf', pdf)
    

Elixir

pdf = StarkBank.Boleto.pdf!("6655767935451136")

File.write!("boleto.pdf", pdf)
    

C#

using System;

byte[] pdf = StarkBank.Boleto.Pdf("6655767935451136");

System.IO.File.WriteAllBytes("boleto.pdf", pdf);
    

Go

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)
}
    

Clojure

(def pdf (starkbank.boleto/pdf "6655767935451136"))

(clojure.java.io/copy pdf (clojure.java.io/file "boleto.pdf"))
    

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto/6655767935451136/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
    

Listing Boletos

You can list all Boletos that match your filters. Use the after and before parameters to filter by creation date.

Python

import starkbank

boletos = starkbank.boleto.query(
    after="2020-04-01",
    before="2020-05-01",
    limit=1
)

for boleto in boletos:
    print(boleto)
    

Javascript

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);
    }
})();
    

PHP

use StarkBank\Boleto;

$boletos = Boleto::query([
    "after" => "2020-04-01",
    "before" => "2020-05-01",
    "limit" => 1
]);

foreach($boletos as $boleto){
    print_r($boleto);
}
    

Java

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);
}
    

Ruby

require('starkbank')

boletos = StarkBank::Boleto.query(
    after: '2020-04-01',
    before: '2020-05-01',
    limit: 1
)

boletos.each do |boleto|
    puts boleto
end
    

Elixir

boletos = StarkBank.Boleto.query!(
    after: "2020-04-01",
    before: "2020-05-01",
    limit: 1
) |> Enum.take(1) |> IO.inspect
    

C#

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);
}
    

Go

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)
    }
}
    

Clojure

(def boletos (starkbank.boleto/query
{
    :after "2020-04-01"
    :before "2020-05-01"
    :limit 1
}))

(doseq [boleto boletos]
    (println boleto))
    

Curl

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}}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

%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"
}
    

C#

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
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
        }
    ]
}
    

Canceling a Boleto

You can cancel a Boleto by its ID. This sends a cancellation request to CIP. Once canceled, the Boleto can no longer be paid.

Python

import starkbank

boleto = starkbank.boleto.delete("6655767935451136")

print(boleto)
    

Javascript

const starkbank = require('starkbank');

(async() => {
    let boleto = await starkbank.boleto.delete('6655767935451136');
    console.log(boleto);
})();
    

PHP

use StarkBank\Boleto;

$boleto = Boleto::delete("6655767935451136");

print_r($boleto);
    

Java

import com.starkbank.*;

Boleto boleto = Boleto.delete("6655767935451136");

System.out.println(boleto);
    

Ruby

require('starkbank')

boleto = StarkBank::Boleto.delete('6655767935451136')

puts boleto
    

Elixir

boleto = StarkBank.Boleto.delete!("6655767935451136") |> IO.inspect
    

C#

using System;

StarkBank.Boleto boleto = StarkBank.Boleto.Delete("6655767935451136");

Console.WriteLine(boleto);
    

Go

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)
}
    

Clojure

(def boleto (starkbank.boleto/delete "6655767935451136"))

(println boleto)
    

Curl

curl --location --request DELETE '{{baseUrl}}/v2/boleto/6655767935451136' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

%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"
}
    

C#

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
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
    }
}
    

Receiving Boleto Webhook

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.

RESPONSE

Python

{
  "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"
      }
    }
  }
}
        

Javascript

{
  "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"
      }
    }
  }
}
        

PHP

{
  "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"
      }
    }
  }
}
        

Java

{
  "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"
      }
    }
  }
}
        

Ruby

{
  "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"
      }
    }
  }
}
        

Elixir

{
  "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"
      }
    }
  }
}
        

C#

{
  "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"
      }
    }
  }
}
        

Go

{
  "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"
      }
    }
  }
}
        

Clojure

{
  "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"
      }
    }
  }
}
        

Curl

{
  "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 Overview

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.

Creating a Boleto Holmes

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.

Python

import starkbank

holmes = starkbank.boletoholmes.create([
    starkbank.BoletoHolmes(
        boleto_id="5656565656565656",
        tags=["sherlock", "holmes"],
    )
])

for holmes in holmes:
    print(holmes)
    

Javascript

const starkbank = require('starkbank');

(async() => {
    let holmes = await starkbank.boletoHolmes.create([
        {
            boletoId: '5656565656565656',
            tags: ['sherlock', 'holmes'],
        }
    ])

    for (let holmes of holmes) {
        console.log(holmes);
    }
})();
    

PHP

use StarkBank\BoletoHolmes;

$holmes = [new BoletoHolmes([
    "boletoId" => "5656565656565656",
    "tags" => ["sherlock", "holmes"]
])];

$boletoHolmes = BoletoHolmes::create($holmes)[0];

foreach($boletoHolmes as $sherlock){
    print_r($sherlock);
}
    

Java

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);
}
    

Ruby

require('starkbank')

holmes = StarkBank::BoletoHolmes.create([
    StarkBank::BoletoHolmes.new(
        boleto_id: '5656565656565656',
        tags: ['sherlock', 'holmes']
    )
])

holmes.each do |sherlock|
    puts sherlock
end
    

Elixir

holmes = StarkBank.BoletoHolmes.create!(
    [
        %StarkBank.BoletoHolmes{
            boleto_id: "5656565656565656",
            tags: ["sherlock", "holmes"],
        }
    ]
) |> IO.inspect
    

C#

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);
}
    

Go

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)
    }
}
    

Clojure

def holmes (starkbank.boleto-holmes/create
[{
    :boleto-id "5656565656565656"
    :tags ["sherlock" "holmes"]
}]))

(doseq [sherlock holmes]
    (println sherlock))
    

Curl

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"],
        },
    ]
}'
    
RESPONSE

Python

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
)
    

Javascript

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'
}
    

PHP

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
        )
)
    

Java

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"
})
    

Ruby

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
)
    

Elixir

  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]
}
    

C#

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,
)
    

Go

{
    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
}
    

Clojure

{
    :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
}
    

Curl

{
    "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"
        }
    ]
}