Issue a batch of boletos
Issues 1 to 25 TRADITIONAL boletos in one request, one per item. All items use one collection account (midazAccountId) and one ledger (ledgerId) of the X-Organization-Id organization.
How it works
- The response is
202with the batch and the status of each item. No item has a barcode yet. - Each item is issued on its own, asynchronously. Follow it with
GET /v1/boletos/batches/{batch_id}or with status change notifications set at/v1/admin/webhooks. - Do not send
guarantor,ledgerIdormidazAccountIdinside an item. - Each item gets a payment deadline: its due date plus the days set for the provider at
/v1/admin/providers/{provider_type}/payment-deadline, or the provider’s default. It shows inpaymentDeadlineon each item and on the item’s boleto. - An item whose fine or interest would start after its deadline is refused as an item problem. Days set above the provider’s maximum are a
PBP-0006onpaymentDeadlineof every item, though no item sends that member. Both refuse the batch with422 PBP-0123. - One item problem refuses the whole batch. Every problem comes in
itemErrors, with the position and field. - The body limit is 256 KiB.
- A retry under the same
Idempotency-Keyand body issues nothing: it returns the stored answer or the batch the key names. - The key is bound to the organization. While the stored answer lives, the same key under another organization is
422 PBP-0013. After it expires, the same key under another organization creates a new batch. - After a refusal for a different body, organization or a fully failed batch, send under a new key.
- Refusals before anything is recorded come in this order: auth,
PBP-0012,PBP-0010,PBP-0001,PBP-0025,PBP-0026,PBP-0122,PBP-0005,PBP-0116,PBP-0117,PBP-0123,PBP-0017. - When the provider settles through this service (today BTG), incomplete accounting routes refuse the batch before anything is recorded. Check them with
GET /v1/admin/accounting-routes/preflight.
Planned changes
PBP-0108: today it names the boleto that holds the nosso número whatever its organization, and reading one of another organization returns404. It will name the holder only when it belongs to theX-Organization-Idorganization.
Encabezados
Cuerpo
Boletos of the batch, from 1 to 25, in the order the client wants to see them. The position of each item is its index in this list, from 0: the position of the response and the index of body.items[] in a refusal. A list outside 1 to 25 items, the empty list included, refuses the whole batch with 422 PBP-0122, which carries the limit and the number of items received; the batch is never split.
Respuesta
Accepted. The batch is recorded and its items are sent for issuance. Each item has its position, its boleto and its status. An item can be recorded FAILED with PBP-0108 when its ourNumber is already in use. Do not resend the batch under a new Idempotency-Key.
- Planned:
PBP-0108names the holder boleto only when it belongs to the same organization.
Issuance outcome of the batch, derived from its items on every read. CREATED: some item is still PENDING. COMPLETED: no item is PENDING and none is FAILED. PARTIAL_FAILURE: no item is PENDING and some, not all, are FAILED; those carry errorCode and errorMessage. FAILED: every item is FAILED. Only issuance moves it: payment, cancellation and write-off do not, and it never moves back to CREATED.
CREATED, COMPLETED, PARTIAL_FAILURE, FAILED 
