Documentation
Look up and cancel boletos
List, read and cancel boletos through the API, track their status at the bank and send the payer the boleto's public page.
Before you start
Lookups use the organization token and return only that organization's boletos (Brazilian bank payment slips). No X-Credential-Key is needed: each boleto is checked and canceled at the bank through the credential that issued it. To issue one, see Issue a boleto.
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer <organization token> |
| Method | Path | Use |
|---|---|---|
GET | /v1/boletos | lists the boletos |
GET | /v1/boletos/:id | reads a boleto |
PATCH | /v1/boletos/:id/cancel | asks the bank to cancel it; requires an active subscription |
List boletos
curl "https://api.intopays.com/v1/boletos?status=OPEN&pageNumber=0&pageSize=50" \
-H "Authorization: Bearer $INTOPAYS_TOKEN"
| Parameter | Required | Values |
|---|---|---|
pageNumber | no | page, from 0 (default) |
pageSize | no | items per page; default 100 |
status | no | one of the values in the Status section |
payerName | no | part of the payer's name |
payerDocument | no | part of the payer's CPF or CNPJ (taxpayer ID) |
referenceCode | no | part of your number |
withCounts | no | true includes totals per situation |
The list comes newest boleto first. payerName, payerDocument and referenceCode match on part of the value; when you send more than one, a boleto is included if it matches any of them. status always narrows the result.
The response has data (the page's boletos, with the same fields as reading by id), pageNumber, pageSize and total (how many match the filters, across all pages).
With withCounts=true, it also carries counts, computed over the same search, without the status filter:
{
"data": [],
"pageNumber": 0,
"pageSize": 50,
"total": 0,
"counts": { "paid": 212, "pending": 18, "processing": 1, "cancelled": 9 }
}
| Field | Counts |
|---|---|
paid | PAID boletos |
pending | OPEN boletos |
processing | PROCESSING boletos |
cancelled | the rest: CANCELLED, EXPIRED and OVERDUE |
Read a boleto
Use the id returned on issue:
curl https://api.intopays.com/v1/boletos/0193a1b2-7c4d-7e8f-9a0b-1c2d3e4f5a6b \
-H "Authorization: Bearer $INTOPAYS_TOKEN"
The API answers 200 with the boleto: the fields sent on issue and the ones returned by the bank.
| Field | Use |
|---|---|
status | the boleto's situation |
digitableLine | the typeable line (linha digitável) |
barcode | barcode |
qrcode | the boleto's Pix copy-and-paste code (Pix is Brazil's instant payment system), at the banks that return it |
integrationBankingCode | "nosso número", the number assigned by the bank |
referenceCode | your number |
credentialId | id of the credential that issued it; null on older boletos |
createdAt, updatedAt | issue and last change |
Status
status | Meaning |
|---|---|
OPEN | Open, waiting for payment |
PAID | Paid |
PROCESSING | Cancellation requested, waiting for the bank's confirmation |
CANCELLED | Written off at the bank |
EXPIRED | Expired at the bank |
OVERDUE | Past due |
EXPIRED and OVERDUE are reported only by Inter. At the other banks, a past-due boleto stays OPEN until it is paid or written off.
The status changes when Intopays checks the boleto at the bank:
| When | What happens |
|---|---|
OPEN or PROCESSING boleto | checked at the bank once a day, up to 120 times |
Read by id | the response carries the stored status and triggers a check at the bank right after; a different status shows on the next read |
The list checks nothing at the bank. Every status change fires the boleto.update event on the organization's webhooks, registered under Integração → Webhooks (Integration → Webhooks).
Cancel
curl -X PATCH https://api.intopays.com/v1/boletos/0193a1b2-7c4d-7e8f-9a0b-1c2d3e4f5a6b/cancel \
-H "Authorization: Bearer $INTOPAYS_TOKEN"
The request has no body. Intopays asks the bank to write off the boleto and answers 200 with the boleto in PROCESSING. The status becomes CANCELLED when the bank confirms the write-off, on the next check. Intopays checks each open boleto with the bank at most once an hour, and also when the bank sends a payment notice (Santander).
A PAID boleto cannot be cancelled: the answer is 400 with Boleto já pago: não pode ser cancelado. (already paid, cannot be cancelled). A boleto that is already CANCELLED comes back as it is, without calling the bank.
The request fires the boleto.delete event on the organization's webhooks. The bank's confirmation fires boleto.update.
Boleto page
Each boleto has a public page for the payer, with the typeable line, the barcode and the Imprimir Boleto (Print boleto) button:
https://intopays.com/payment/<id>/boleto
The page needs no sign-in: anyone with the link sees the boleto. Send the link only to the payer. In the dashboard, the same boleto is under Banking → Boletos, with the print and cancel actions.
Errors
| Status | Response | Fix |
|---|---|---|
401 | missing or invalid token; on cancel, also an inactive subscription | See Authentication |
403 | { "status": false } | The boleto does not exist or belongs to another organization. Check the id and the token |
| the bank's status | on cancel, the status and body returned by the bank | The bank refused the write-off. Check the boleto's situation at the bank |
500 | Internal server error | The cancellation failed before reaching the bank. Check that the credential that issued the boleto still exists |
Missing something on this page? Contact support from the dashboard and we'll update the docs.
