The plugin supports intra-PSP transfers and refunds. It settles them internally and reports each one to BACEN through TRCK002.
Detection
The plugin marks a transfer as intra-PSP when the destination ISPB matches the payer’s ISPB, the
bankingDetails.bankId of the payer’s alias account in the CRM:
Detection is internal. The initiation response and the cashout status match an external transfer. The plugin routes an intra-PSP transfer through the internal settlement path instead of BTG. A Pix Saque or Pix Troco charge cannot settle internally: the plugin rejects it with
PIX-0497 (422).
Processing model
An intra-PSP transfer uses the same Midaz routing as an external transfer, through the
@external transit account. The ledger behavior is identical. The plugin settles the transfer synchronously and does not wait for BTG webhooks.
The plugin creates two Midaz transactions per transfer:
- Cashout:
source → @external(pending: false) - Cashin:
@external → destination(pending: false)
Flow
The cashout responds with
PROCESSING, like an external cashout that waits for BTG. The plugin delivers the final status (COMPLETED or REJECTED) asynchronously through an outbound webhook. The intra-PSP endpoint is idempotent, so worker retries never duplicate transactions.TRCK002 regulatory reporting
The plugin reports every successful intra-PSP transaction to BACEN through BTG’s TRCK002 endpoint.
- TRCK002 reporting is non-blocking. A report failure never rolls back the Midaz transaction or the transfer completion. The plugin retries a failed report.
- The plugin creates a transaction report for each transaction. After BTG accepts the submission, the report status becomes
PROCESSINGand carries apactualId. - BTG sends report status updates through a CAMT025 webhook, typed
PIX_INTERNAL_TRANSACTIONS_REPORT. The webhook moves the report toCONFIRMED(terminal) orERROR(recoverable). - You can also query a report by end-to-end ID or return identification when a webhook does not arrive.
Intra-PSP refunds
The plugin also processes a refund internally when the original cash-in was intra-PSP:
- The plugin detects intra-PSP from the original transfer, when its source and destination ISPB match.
- It debits the refund requester (
requester → @external). It then delivers the refund cash-in to the original sender through the same queue and endpoint pattern. - The plugin reports the refund to TRCK002 with a
returnIdentification. - The plugin sends a
REFUND/CASHOUTwebhook for the refund requester and aREFUND/CASHINwebhook for the original sender.
Next steps
- Webhooks: Event envelope, retries, and routing
- Refund operations: Distributed refunds and unblocking
- Setting up the integration: ISPB and worker configuration
- API reference: Full API documentation

