Avistadocs
Integration Guides

MED — Special Refund Mechanism

What is MED?

MED (Special Refund Mechanism — "Mecanismo Especial de Devolução") is a mechanism regulated by the Central Bank of Brazil that allows amounts in PIX transactions to be refunded when there is suspicion of fraud or operational failure. Unlike a regular reversal, MED involves formal analysis between financial institutions, with deadlines and rules defined by BACEN.

MED is a mandatory regulatory process. Your company must be prepared to receive, analyze, and respond to MED notifications within the deadlines established by the Central Bank.

When is a MED opened?

A MED may be triggered by the payer's bank (requesting bank) in two scenarios:

ScenarioDescriptionExample
FraudSuspected unauthorized transaction, social engineering, fraudulent accessPayer claims they did not perform the PIX
Operational failureSystem error that resulted in undue creditDuplicated PIX due to technical failure

Causes

The cause field indicates the MED reason when available (e.g., UNAUTHORIZED_TRANSACTION, SOCIAL_ENGINEERING). In some cases cause may be null — in that scenario, description contains descriptive text about the request.

Possible cause values

ValueDescription
UNAUTHORIZED_TRANSACTIONPayer claims they did not authorize the transaction
FRAUDULENT_ACCESSUnauthorized access to the payer's account
SOCIAL_ENGINEERINGManipulation-based scam (e.g., fake bank employee)
OPERATIONAL_FAILURETechnical error that generated undue credit
nullCause not classified — see description for details

The cause field can be null when the request origin does not provide a structured code. In those cases, the description field contains descriptive text (e.g., payer report, formal bank notification). In your integration, treat cause as optional and always display description as complementary information.

The platform synchronizes MEDs automatically with the PIX providers configured in your account. Sync frequency may vary. Use GET /api/med to check up-to-date status at any time.

Your company's role

When a MED is received, your company is the contested bank — the bank that received the PIX on behalf of your client (the beneficiary). You must:

  1. Receive the notification — via the MedCreated webhook
  2. Analyze the situation — check whether the transaction is legitimate
  3. Block the balance (if applicable) — retain the amount for possible refund
  4. Respond to the MED — accept (refund) or reject (contest) the request

Balance blocking and MED response are managed internally by the platform. Your integration only needs to monitor webhooks to follow the MED status and take actions in your system (notify the client, update records, etc.).

MED Lifecycle

┌─────────────────────────────────────────────────────────────────┐
│                        MED LIFECYCLE                            │
│                                                                 │
│  ┌──────────┐    ┌──────────┐    ┌───────────┐                │
│  │   OPEN   │───▶│ RECEIVED │───▶│ ANALYZED  │                │
│  └──────────┘    └──────────┘    └─────┬─────┘                │
│       │                                │                       │
│       │                          ┌─────┴─────┐                │
│       ▼                          ▼           ▼                │
│  ┌───────────┐            ┌──────────┐ ┌──────────┐          │
│  │ CANCELLED  │            │ APPROVED │ │ REJECTED │          │
│  └───────────┘            └──────────┘ └──────────┘          │
│                                │           │                   │
│                                ▼           ▼                   │
│                          Amount is    Balance is              │
│                          refunded to  unblocked for           │
│                          the payer    the beneficiary         │
└─────────────────────────────────────────────────────────────────┘

MED statuses

Status (status)DescriptionWebhook
OPENMED created by the requesting bank
RECEIVEDMED received and under analysisMedCreated
CANCELLEDMED canceled by the requesting bank (before analysis)
ANALYZEDAnalysis completed with a resultMedAccepted or MedRejected

Analysis result

Result (analysisResult)DescriptionWebhookFinancial impact
APPROVEDRefund accepted — amount returned to payerMedAcceptedAmount debited from beneficiary account
REJECTEDRefund denied — balance remains with beneficiaryMedRejectedBalance unblocked

Regulatory Deadlines (BACEN)

MED is regulated by the Central Bank of Brazil and has specific deadlines to acknowledge receipt, analyze the request, and respond to the requesting bank. Failing to respond within the deadline can result in automatic refund approval and regulatory reporting to BACEN.

The exact deadlines follow the current Central Bank regulation (applicable BCB Resolution for PIX MED) and may be updated by the regulator. Consult your legal / compliance team for the most recent binding values before sizing internal SLAs.

Operational recommendations:

  • Configure internal alerts with a buffer before the regulatory deadline (e.g., T-24h before expiry) to avoid automatic approval by inaction.
  • Monitor the MedCreated webhook in real time — this is the trigger to start the analysis-deadline countdown.
  • Internally document the response policy (who analyzes, who approves, who responds to the MED) and test the end-to-end flow before going to production.
  • Keep evidence (logs, defense documents, communication history) for regulatory audit.

Integration flow

Use POST /api/webhooks to configure callback URLs for med_created, med_accepted, and med_rejected events. See the webhook setup guide.

When a MED is opened against a transaction on your account, you receive a webhook with details: cause, requesting bank, original transaction, and status.

Use GET /api/med to query MED status anytime. Filter by status, date, or reconciliation.

When analysis concludes, you receive MedAccepted (refund approved) or MedRejected (refund denied). Update your records accordingly.

Next Steps

On this page