Skip to main content
Pix Automático lets a customer authorize a recurring debit once, in their own bank, after which Portão 3 collects each charge automatically. You create an authorization, send the customer to its approval page, and then follow the authorization and its charges through webhooks or by reading them back. This guide also covers changing a charge’s amount, canceling, and falling back to boleto when a charge fails.

Flow

Step 1: Create the authorization

The response is 201 Created: the authorization, status CREATED, with the paymentUrl and every charge in schedules — the first payment (isFirstPayment: true) and each recurring charge, all CREATED:
The authorization keeps its own dates: schedule.startDate is two days before the schedule.startDate you sent — or the day after the first payment, when that is later — and schedule.endDate the day after the one you sent. Redirect the customer to paymentUrl to approve the authorization in their bank. Reference: POST .../wallets/{walletId}/pix-billing-automatic

Step 2: Follow the authorization lifecycle

The PIX_BILLING_AUTOMATIC_* events track the authorization itself (the consent the customer approves): When the customer revokes the authorization in their bank, it moves to REVOKED and its pending charges are canceled; that change has no webhook, so read the authorization back.
To read it at any time, with all its charges, use GET .../pix-billing-automatic/{pixBillingAutomaticId}.

Step 3: Follow each charge

The PIX_BILLING_AUTOMATIC_SCHEDULE_* events track the individual charges:
When the customer’s bank can’t debit a charge, Portão 3 asks for a new attempt a day or two later — up to three attempts in all, counting the one on the due date, each listed in the charge’s attempts — unless the refusal is final (for example, the customer’s limit for the period was reached). Then the charge becomes FAILED. A charge the customer’s bank refuses to schedule has no webhook: it ends as SCHEDULE_ERROR, or stays CREATED past its date with no external.scheduleId and a SCHEDULE_ATTEMPT_FAILED event in its history. If you rely on webhooks, also check the wallet’s charges for status=SCHEDULE_ERROR (treat it like FAILED) and for status=CREATED with a past maxDueDate. Such a CREATED charge was most likely refused — but in rare cases the customer’s bank accepted it and the confirmation was lost, so confirm with Portão 3 support before charging it another way. A charge CREATED past its date that does carry external.scheduleId is still being processed by the customer’s bank: wait for its outcome — don’t charge it another way. To see what is due and what was paid across all the wallet’s authorizations, use GET .../wallets/{walletId}/pix-billing-automatic/schedules, filtered by status and due date. The events of an authorization — its creation and cancellations, each update from the customer’s bank, with its error — are in GET .../pix-billing-automatic/{pixBillingAutomaticId}/history.

Change a charge’s amount

Adjust an individual charge (for example, a partial charge) by updating it, referencing both the authorization ID and the charge ID:
The new amount (centavos) must stay within the authorization’s minAmount/maxAmount range, so plan a variable range when you create the authorization if you’ll need it. Only a recurring charge that hasn’t been sent to the customer’s bank yet (CREATED) can change; the first payment can’t, it goes with the authorization. Reference: PUT .../pix-billing-automatic/{pixBillingAutomaticId}/schedules/{pixBillingAutomaticScheduleId}. To list and filter authorizations, use GET .../wallets/{walletId}/pix-billing-automatic.

Cancel

A charge already sent to the customer’s bank can’t be canceled on or after its date. Both answer 204 No Content.

Fall back to boleto on repeated failure

When charges keep failing (FAILED or SCHEDULE_ERROR), issue a boleto for the same amount so the customer can still pay:
The boleto comes back CREATED, with the digitableLine and barcode to present to the customer — or download its PDF with GET .../boleto-billing/{boletoId}/download/pdf. Rarely it comes back INITIATED, without them yet: read it back until it is CREATED. There is no webhook for a boleto charge, so read it back with GET .../boleto-billing/{boletoId} to know when it is PAID. You can also add discount, fine, and interest rules (txnDiscountAmount, txnFineAmount, txnInterestAmount) — see Charge with a boleto and the endpoint reference for the full body. Reference: POST .../wallets/{walletId}/boleto-billing

Next steps

Receive webhooks

Delivery envelope and the full event catalog.

Charge with PIX

One-off PIX charges with a QR Code.