docs
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, the description field contains the descriptive text of 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 the description field 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 records the MEDs reported by your account's settlement provider and links them to the original transaction when it finds the matching receipt (isReconciled: true). Use GET /api/med to check the up-to-date status at any time.

Your company's role

When a MED is opened against a PIX received in your account, the contested institution is the one that received the PIX, and your company (or your client) is the beneficiary. In the flow:

  1. You receive the notification — via the MedCreated webhook
  2. You analyze the situation — check whether the transaction is legitimate and gather evidence
  3. The balance may be blocked — the contested amount is retained for possible refund
  4. The MED is answered — the refund is accepted or rejected, and you receive MedAccepted or MedRejected

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)Description
OPENMED created by the requesting bank
RECEIVEDMED received and under analysis
CANCELLEDMED canceled by the requesting bank (before analysis)
ANALYZEDAnalysis completed with a result (see analysisResult)

When each webhook is sent

Webhook (event)Event to configureWhen
MedCreatedmed_createdThe MED is recorded on the platform and linked to a receipt in your account. The status comes in the payload (usually OPEN or RECEIVED)
MedAcceptedmed_acceptedThe refund is approved and the amount is returned to the payer
MedRejectedmed_rejectedThe refund is rejected and the blocked balance is released

MEDs that could not be linked to a transaction in your account (isReconciled: false) do not generate a webhook. They appear in GET /api/med.

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 the dashboard (https://banking.fypay.me), under Settings → Webhooks, to configure callback URLs for the 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 at any time (filter by status, date, or reconciliation) and GET /api/med/\{id\} to see the details of a MED, including the status history and the block.

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

Next Steps

On this page