Guides
Carnês
Issue a series of monthly boletos, follow the parcels, postpone due dates and simulate payments.
A carnê is a series of boletos (Bolix) due monthly. Each parcel is its own charge, with a charge_id, and all of them share the carnê's notification token. Authentication and host are in Boleto and Bolix.
1. Create the carnê
curl --request POST \
--url https://cobrancas.efi.mimicr.dev/v1/carnet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"items": [{ "name": "Mensalidade", "value": 7500, "amount": 1 }],
"customer": { "name": "Gorbadoc Oldbuck", "cpf": "94271564656", "email": "oldbuck@efipay.com.br", "phone_number": "5144916523" },
"expire_at": "2026-10-26",
"configurations": { "fine": 200, "interest": 33 },
"repeats": 3,
"metadata": { "custom_id": "pedido-1042", "notification_url": "https://sua-app.dev/webhooks/efi" }
}'{
"code": 200,
"data": {
"carnet_id": 10011,
"status": "up_to_date",
"cover": "https://cobrancas.efi.mimicr.dev/emissao/cbbfd078e0.../capa",
"link": "https://cobrancas.efi.mimicr.dev/emissao/cbbfd078e0...",
"carnet_link": "https://cobrancas.efi.mimicr.dev/emissao/cbbfd078e0...",
"pdf": { "carnet": "https://cobrancas.efi.mimicr.dev/emissao/cbbfd078e0....pdf", "cover": "https://cobrancas.efi.mimicr.dev/emissao/cbbfd078e0.../capa.pdf" },
"charges": [
{ "charge_id": 1000012, "parcel": "1", "status": "waiting", "value": 7500, "expire_at": "2026-10-26", "barcode": "36490.00001 01000.012342 22563.055023 1 16110000007500", "pix": { "qrcode": "000201..." }, "url": "https://cobrancas.efi.mimicr.dev/emissao/aff331b5f2..." },
{ "charge_id": 1000013, "parcel": "2", "status": "waiting", "value": 7500, "expire_at": "2026-11-26" },
{ "charge_id": 1000014, "parcel": "3", "status": "waiting", "value": 7500, "expire_at": "2026-12-26" }
]
}
}repeatsgoes from 2 to 24 (3500041below,4600059above).- Parcels are due every month on the same day as
expire_at; in shorter months, on the last day. - Without
split_items, each parcel is worth the items' total (here, 3 × R$ 75.00). Withsplit_items: true, the total is split across the parcels. - On creation,
parcelis a string ("1"); in Get a carnê it's an integer, and the response carriesvalue(the total),repeatsand the history.
Reference: Create a carnê.
2. Carnê status
| Status | When |
|---|---|
up_to_date | No parcel overdue |
unpaid | A parcel passed its due date unpaid |
finished | Every parcel resolved (paid, settled, canceled or expired); never changes again |
canceled | The carnê was canceled |
The status is recomputed on every parcel change, and each change generates a carnet event on the token. Parcels generate carnet_charge events with identifiers: {carnet_id, charge_id}. See Notifications.
3. Simulate payments
Each parcel is paid like a boleto, by its charge_id:
npx mimicr action efi cobrancas.charge id=1000012 action=pagar npx mimicr action efi cobrancas.charge id=1000013 action=vencer
After that the carnê is unpaid, because parcel 2 is overdue. For the whole carnê, the cobrancas.carnet action:
action | Effect |
|---|---|
baixa | Marks the open parcels as paid (settled) |
cancelar | Cancels the open parcels and the carnê |
curl --request POST \
--url https://api.mimicr.dev/v1/efi/actions/cobrancas.carnet \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "id": "10011", "action": "baixa" }'4. Postpone due dates
curl --request PUT \
--url https://cobrancas.efi.mimicr.dev/v1/carnet/10011/parcels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "parcels": [{ "parcel": 3, "expire_at": "2027-01-29" }] }'Only waiting or unpaid parcels, to today or later and never before the current due date. An unpaid parcel with a new date goes back to waiting. Errors come as 3500101 update_parcels, with the parcel number:
{ "code": 3500101, "error": "update_parcels", "error_description": "A propriedade [expire_at] informada é inválida. Não é possível antecipar o vencimento Parcela: [3]." }For a single parcel, Update a parcel due date.
5. Other operations
| To | Use |
|---|---|
| Cancel the carnê or a parcel | Cancel a carnê, Cancel a parcel |
| Manual write-off | Mark a carnê as paid, Mark a parcel as paid |
Change custom_id or URL (carnê and parcels) | Update carnê metadata |
| Resend by e-mail | Resend the carnê, Resend a parcel (waiting only) |
| Add a note | Add to the carnê history |
A finished carnê answers 3500083 to any change; a canceled one, 3500068.