Skip to main content
POST
Issue installment boletos

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

X-Organization-Id
string

Midaz organization the account and every installment 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
firstDueDate
string<date>
required

Due date of the first installment, YYYY-MM-DD. On LERIAN each installment's due date must be at most 3650 days after the day of issuance; otherwise 422 PBP-0006 naming the member, before anything is recorded.

Example:

"2030-01-15"

installments
integer<int64>
required

Number of installments.

Example:

2

intervalDays
integer<int64>
required

Days between consecutive installments.

Example:

30

midazAccountId
string
required

Midaz account the series settles into.

payer
object
required
type
string
required

Boleto type applied to every installment.

Example:

"TRADITIONAL"

discount
object

Discount of every installment. Its limitDate is absolute: the same date on every installment, before firstDueDate. For a discount whose date follows each installment's due date, send discounts. Send either discount or discounts, never both: the two together are refused with 422 PBP-0006 naming discounts.

discounts
object[] | null

Discount bands, one to three, in the order they apply, written for the first installment: each installment gets the same number of days, between its limitDate and firstDueDate, before its own due date. Every band has the first band's type, and each limitDate is after the previous band's and before firstDueDate; otherwise 422 PBP-0006 naming the band, as in discounts[1].limitDate. More than one band, on a provider that does not register them, is refused with 422 PBP-0701 naming BOLETO_DISCOUNT_BANDS in the capability member.

Required array length: 1 - 3 elements
documentNumbers
string[] | null

Payee's own reference for each installment (seu numero), such as an invoice number: one per installment, in installment order, at most 36. Optional: when absent or null, no installment carries one; an empty list is refused with 422 PBP-0102, as is a list of another length. Each item follows the rule of documentNumber on POST /v1/boletos: 1 to 15 printable ASCII characters (space through tilde), stored as given; an item that is empty, longer than 15 characters, made only of spaces, that carries any other character or that carries markup is refused with 400 PBP-0001 naming it as documentNumbers[], counted from 0. When the provider that serves the issuance does not register it, the series is refused with 422 PBP-0701, naming BOLETO_DOCUMENT_NUMBER in the capability member; nothing is recorded and the provider is not called.

Maximum array length: 36
Required string length: 1 - 15
Pattern: ^[ -~]{1,15}$
Example:
fine
object
installmentAmounts
string[] | null

Per-installment amounts, at most 36. When supplied, its length must match installments. On LERIAN each installment's amount must be below 100000000.00; otherwise 422 PBP-0006 naming the member, before anything is recorded.

Maximum array length: 36
Maximum string length: 32
interest
object
ledgerId
string

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

ourNumbers
string[] | null

Bank-side identification (nosso numero) chosen by the payee for each installment: one number per installment, in installment order, at most 36. All or none: when absent or null, the provider assigns every number, and an empty list is refused with 422 PBP-0102, as is a list of another length. Each item follows the rule of ourNumber on POST /v1/boletos: surrounding spaces are removed, a hyphen is accepted only when followed by exactly one digit, which is discarded, and any other character that is not a digit is refused; the accepted width, in significant digits, is set by the provider that serves the issuance and can differ between providers: read it as numbering.maxWidth of that provider in GET /v1/admin/providers/capabilities. A format or width refusal answers 400 PBP-0001 naming the item as ourNumbers[], counted from 0. Two installments with the same number, leading zeros ignored, are refused with 422 PBP-0102, and the problem carries the installments, counted from 1, as duplicateInstallmentNumbers. A number already held by an active boleto of this tenant on the same provider account refuses the whole series with 422 PBP-0108 before the provider is called, and the problem carries the installment as installmentNumber and, when the holder can be read and is not a hybrid boleto, its id as ourNumberHolderBoletoId. Only a series with numbers depends on the provider account lookup: 422 PBP-0017 when the provider has no numbering account for the series' midazAccountId (the installation has no account discovery, or the account is not yet enabled at the provider), 422 PBP-0014 when the provider refuses the lookup and 503 PBP-0015 when the provider does not answer.

Maximum array length: 36
paymentDeadline
string<date>

Last day the first installment can be paid, YYYY-MM-DD; each installment gets the same number of days added to its own due date. On or after firstDueDate and at most the maximum the provider declares after it, LERIAN declaring none; otherwise 422 PBP-0006 naming paymentDeadline. Absent, each installment's deadline is its due date plus the days the tenant set for the provider or, with none set, plus the provider's default; on LERIAN, plus the paymentDeadlineDays of the agreement the installment is issued under. A provider that does not register it refuses it with 422 PBP-0701 naming BOLETO_PAYMENT_DEADLINE in the capability member.

Example:

"2030-01-25"

totalAmount
string

Series total as a decimal string. Optional: either this or installmentAmounts must be supplied.

Maximum string length: 32
Example:

"100.00"

Response

Created. The series is recorded with its installments in PENDING. A retry under the same key returns the series in its current state.

boletos
object[] | null
required
closed
boolean
required

Whether no installment of the series can still be paid: true when every installment is SETTLED, CANCELED, INACTIVATED, REVERSED or FAILED. Always present. It can return to false when the provider reverts the cancellation of an installment.

installmentsCount
integer<int64>
required
ledgerId
string
required

Midaz ledger the installments were written with. Always present.

organizationId
string
required

Midaz organization the installments were written with. Always present, and always the organization of the X-Organization-Id header.

seriesId
string
required
status
enum<string>
required

Emission outcome of the series, derived from its installments on every read. CREATED: some installment has no emission outcome yet. COMPLETED: every installment has an outcome and none is FAILED. PARTIAL_FAILURE: every installment has an outcome and some, not all, are FAILED; those carry errorMessage. FAILED: every installment is FAILED. It does not depend on payment, cancellation or write-off, and it can move from COMPLETED to PARTIAL_FAILURE or FAILED when the provider later refuses an accepted installment: a client waiting for the final outcome reads closed.

Available options:
CREATED,
COMPLETED,
PARTIAL_FAILURE,
FAILED
totalAmount
string
required