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. Declared optional on the schema so that refusal keeps its own code instead of the schema's PBP-0001.

Idempotency-Key
string

Client-supplied idempotency key. Required in practice even though the schema marks it optional: a request that omits this header is refused with 400 PBP-0012.

Body

application/json
amount
string
required

Amount as a decimal string, at most two decimal places.

Maximum string length: 32
Example:

"100.00"

dueDate
string<date>
required

Due date, YYYY-MM-DD.

Example:

"2030-01-15"

midazAccountId
string
required

Midaz account the boleto settles into.

payer
object
required
type
string
required

Boleto type. Only TRADITIONAL is supported in V1. HYBRID (BolePix) and QR_CODE are refused with 422 PBP-0006.

Example:

"TRADITIONAL"

discount
object
fine
object
guarantor
object
instructions
string
interest
object
ledgerId
string

Midaz ledger the account lives in and the entry is posted to. Required: absent, blank or not a canonical UUID is refused with 400 PBP-0026.

ourNumber
string

Bank-side identification of the boleto (nosso numero), chosen by the payee. Optional: when absent, the provider assigns the number. Surrounding spaces are removed. A hyphen is accepted only when followed by exactly one digit, which is discarded because the check digit is always computed by the bank: 152-3 is sent as 152, while 152- and 152-abc are refused. Any other character that is not a digit is refused. Leading zeros do not make a different number: 152 and 00000000152 are the same number for the current provider, and two active boletos of the same provider account cannot hold it at the same time, whatever their amount or due date. The accepted width is set by the connected provider (11 significant digits for the current one). Format and width refusals answer 400 PBP-0001; a provider that does not accept a number chosen by the payee refuses the field with 422 PBP-0006. A number already held by an active boleto of the same provider account is refused with 422 PBP-0108 before the provider is called. When the holder can be read, the PBP-0108 detail names the boleto that holds the number, and the problem carries its id as ourNumberHolderBoletoId; when it is an earlier emission that has no answer from the provider yet, the detail says so instead of asking for another number; otherwise it asks for that boleto to be consulted before another number is informed, because it may be an earlier emission of the same charge. After a 422 PBP-0014, or a 5xx, answered to an emission with ourNumber, the number can stay held until the periodic reconciliation resolves that emission, which it does not do before a grace period set by the deployment (30 minutes by default); meanwhile that emission can still become a live boleto, and issuing the same charge again with another number can leave two boletos for it.

Example:

"00000000152"

Response

Created

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.

providerId
string
required
status
string
required
type
string
required
barcode
string
digitableLine
string
discount
object
fine
object
instructions
string
interest
object
ourNumber
string

Bank-side identification of the boleto (nosso numero), as assigned by the provider and printed on the instrument. Read from the barcode and returned in the instrument's form, with leading zeros: the width is set by the connected provider (11 digits for the current one). When the payee supplied ourNumber on issuance, this field still reports the instrument and not the value supplied: if the two differ, the value here is the one printed on the boleto, and the divergence is recorded by the service. Optional: absent for boletos issued before this field existed, and absent while the provider has not produced a valid barcode. Absence means not yet known; the periodic reconciliation fills it in once the provider produces the instrument, with no action needed from the client; it is never sent as an empty string.

Example:

"00000000029"

ourNumberDigit
string

Check digit of ourNumber, computed by the bank and never accepted in a request. Optional: absent whenever the provider did not return it, in which case ourNumber is presented alone, with no trailing hyphen. It is absent in particular when the payee supplied ourNumber: the current provider returns the digit only for numbers it assigned itself. When present, the canonical presentation is {ourNumber}-{ourNumberDigit}.

Example:

"3"

qrCode
string