Skip to main content
POST
Issue a single boleto

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

X-Organization-Id
string

Midaz organization the account and the ledger entry live under. Required: a request without it, or with a value that is not a canonical UUID, is refused with 400 PBP-0025.

Idempotency-Key
string
required

Client-supplied idempotency key, a UUID. Required: a request without it, with a value that is not a UUID, or with the nil UUID (00000000-0000-0000-0000-000000000000) is refused with 400 PBP-0012.

Body

application/json
amount
string
required

Face value in BRL, as a decimal string with up to 2 decimal places.

  • Lerian (PCR): must be below 100000000.00. Otherwise 422 PBP-0006 naming the member, before anything is recorded.
Maximum string length: 32
Example:

"100.00"

dueDate
string<date>
required

Due date, YYYY-MM-DD.

  • Lerian (PCR): at most 3650 days after the issuance day. Otherwise 422 PBP-0006 naming the member, before anything is recorded.
Example:

"2030-01-15"

midazAccountId
string
required

Midaz account the boleto settles into. Its holder is the final beneficiary.

payer
object
required
type
string
required

Boleto type. Send TRADITIONAL. QR_CODE is refused with 422 PBP-0006. HYBRID is refused with 501 PBP-0127: hybrid boletos (boleto with Pix) are not available.

Example:

"TRADITIONAL"

discount
object

One discount band, granted when the boleto is paid on or before limitDate. Use discounts for more than one. Sending discount and discounts together is refused with 422 PBP-0006 naming discounts.

discounts
object[] | null

1 to 3 discount bands, in the order they apply. Each band grants its amount when the boleto is paid on or before its limitDate.

  • All bands have the type of the first band.
  • Each limitDate is after the previous one and before the due date. Otherwise 422 PBP-0006 naming the band, as in discounts[1].limitDate.
  • One band is the same as discount. Do not send both (422 PBP-0006 naming discounts).
  • More than one band, on a provider that does not register them, is refused with 422 PBP-0701 and capability BOLETO_DISCOUNT_BANDS.
Required array length: 1 - 3 elements
documentNumber
string

Your own reference for the charge (seu número), such as an invoice number. Optional. It does not have to be unique, and it is stored as sent.

  • 1 to 15 printable ASCII characters (space through tilde: letters without accents, digits, space and punctuation).
  • Empty, longer than 15 characters, only spaces, any other character (accented letter, control character, non-ASCII) or markup: 400 PBP-0001. A longer value is refused, never cut.
  • A provider that does not register it refuses it with 422 PBP-0701 and capability BOLETO_DOCUMENT_NUMBER. Nothing is recorded and the provider is not called.
Required string length: 1 - 15
Pattern: ^[ -~]{1,15}$
Example:

"NF-2030/0001"

fine
object
instructions
string

Free-text instructions printed on the boleto. Optional.

  • BTG: accepted.
  • Lerian (PCR): non-empty instructions are refused with 422 PBP-0701 and capability BOLETO_INSTRUCTIONS. Nothing is recorded and the provider is not called.
interest
object
ledgerId
string

Midaz ledger the account belongs to and the entry is posted to. Required. Absent, blank or not a canonical UUID: 400 PBP-0026.

ourNumber
string

Bank identification of the boleto (nosso número), chosen by you. Optional: without it, the provider assigns the number.

  • Digits only. Surrounding spaces are removed. A hyphen is accepted only when followed by exactly one digit, which is dropped because the bank computes the check digit: 152-3 is sent as 152; 152- and 152-abc are refused.
  • Leading zeros do not count: 152 and 00000000152 are the same number.
  • Maximum width, in significant digits: BTG 11, Lerian (PCR) 16. Read numbering.maxWidth in GET /v1/admin/providers/capabilities.
  • Format and width refusals: 400 PBP-0001. A provider that does not accept a number you choose: 422 PBP-0701 with capability CLIENT_SUPPLIED_OUR_NUMBER.
  • A number held by an active boleto of any type of the same provider account (a hybrid issued earlier included) is refused with 422 PBP-0108, before the provider is called. When the holder can be read, the detail names it and ourNumberHolderBoletoId carries its id. It can be an earlier emission of the same charge: read it before you use another number. When it is an emission still without a provider answer, the detail says so.
  • After a 422 PBP-0014 or a 5xx answered once the emission was sent, the number stays held until reconciliation resolves that emission, which happens no earlier than a grace period (30 minutes by default). Meanwhile that emission can still become a live boleto: issuing the same charge with another number can leave two boletos. Refusals answered before the emission was sent hold nothing.
Example:

"00000000152"

paymentDeadline
string<date>

Last day the boleto can be paid, YYYY-MM-DD. On or after the due date.

  • Maximum: BTG, 365 days after the due date. Lerian (PCR), no maximum. Out of range: 422 PBP-0006 naming paymentDeadline. A fine or interest start date after it is refused the same way.
  • Without it: BTG uses the due date plus the days set for the tenant, or 30 days. Lerian (PCR) uses the due date plus the paymentDeadlineDays of the agreement the boleto is issued under.
  • A provider that does not register it refuses it with 422 PBP-0701 and capability BOLETO_PAYMENT_DEADLINE.
Example:

"2030-02-14"

Response

Created. The provider accepted the boleto: the body has its providerId. The boleto stays PENDING until the provider confirms the registration. With BTG the body also has barcode and digitableLine. With Lerian (PCR) they appear once the registration is confirmed and the boleto is CREATED: read it with GET /v1/boletos/{id}.

amount
string
required
createdAt
string
required
dueDate
string
required
id
string
required
ledgerId
string
required

Midaz ledger the boleto was written with. Always present.

organizationId
string
required

Midaz organization the boleto was written with. Always present.

status
string
required
type
string
required
barcode
string
digitableLine
string
discount
object

The first discount band, whether it was sent as discount or first in discounts.

discounts
object[] | null

Every discount band of the boleto, in the order they apply, the first included. Absent when the boleto grants no discount.

documentNumber
string

Your reference for the charge (seu número), as sent. Present only when sent. It can hold quotes, &, =, +, - or @: encode it for where you write it, such as a spreadsheet cell or a web page.

fine
object
guarantor
object

Final beneficiary (sacador avalista): the holder of the issuing account, read from the account registration at issuance. The request never chooses it, and every boleto carries it.

instructions
string
interest
object
ourNumber
string

Bank identification of the boleto (nosso número), as the provider registered it, with leading zeros, at the provider's width. If you sent a different number, this is the one the provider issued.

  • Absent while the provider has not made it known, and on boletos issued before this field existed. Reconciliation fills it in later, with no action from you.
  • Never sent as an empty string.
Example:

29

ourNumberDigit
string

Check digit of ourNumber, computed by the bank and never accepted in a request. Absent when the provider does not return it: providers return it only for numbers they assigned, and some never return it. Without it, show ourNumber alone, with no trailing hyphen. With it, show {ourNumber}-{ourNumberDigit}.

Example:

"3"

paymentDeadline
string<date>

Last day the boleto can be paid, YYYY-MM-DD: the one you sent or, without it, the tenant setting or the provider default (Lerian (PCR): due date plus the agreement's paymentDeadlineDays). Absent when the provider registers no deadline, while Lerian (PCR) has not answered the emission, and on a resend answered by a boleto recorded before the service stored the deadline.

Example:

"2030-01-31"

pixLocation
string

Location of the dynamic Pix QR code of a hybrid boleto, whose payload is qrCode. Hybrid boletos (boleto with Pix) are not available on this service, so this member is absent.

Example:

"pix.example.com/qr/v2/cobv/5d9a8e91c88c43db942d01a0ad92ffc3"

pixTxId
string

Identifier of the due-date Pix charge of a hybrid boleto. Hybrid boletos (boleto with Pix) are not available on this service, so this member is absent.

Example:

"35dabf21d3b941e8a937409b8749f281"

providerId
string

Identifier the banking provider assigned to this boleto. Absent from the 202 response, while the provider's answer is not confirmed; read the boleto with GET /v1/boletos/{id} for its current state.

qrCode
string

Pix copy-and-paste code of a hybrid boleto's Pix charge. Hybrid boletos (boleto with Pix) are not available on this service, so this member is absent.