The MED (Special Refund Mechanism) is a procedure from Brazil's Central Bank designed to protect Pix users in cases of fraud, scams, or unauthorized transactions.
It functions as a "safety net" of the arrangement: when suspicious activity is identified, the payer's institution can open a formal process requesting the amount to be returned.
How it works at PayZu
The MED flow at PayZu is delivered through a webhook that reuses the same
callbackUrlfrom the transaction, always updating the status of the original operation and inserting theinfractionobject into the payload.
Conceptual Flow of MED
┌─────────────────────────────────────────┐
│ Pix transaction performed │
└─────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Problem identified │
│ (fraud / error / unauthorized charge) │
└─────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Payer's institution opens MED in arrangement │
│ Webhook: status = OPEN │
└─────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Receiver's bank is notified │
│ May block the amount during analysis │
└─────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Dispute analysis │
│ (institutions + Central Bank rules) │
└────────┬────────────────────────┬────────────────────┘
│ │
▼ ▼
ACCEPTED REJECTED
status = CLOSED status = CLOSED
result = AGREED result = DISAGREED
│ │
▼ ▼
Amount returned Transaction
to payer remains valid
Webhook Example with Infraction (MED)
Below is a real example of the payload you receive when a Pix transaction suffers an infraction:
{
"id": "PAYZU20251123104518DF75D20A8F",
"type": "DEPOSIT",
"status": "COMPLETED",
"serviceFeeCharged": 1,
"amount": 30,
"clientReference": "d2b2a5ed-f1a4-477e-81da-9",
"qrCodeText": "00020101021226870014br.gov.bcb.pix...",
"payerName": "John Doe",
"payerDocument": "12345678901",
"payerInstitutionName": "PAYZU IP",
"receiverName": "PAYZU LTDA",
"receiverDocument": "123456789010110",
"endToEndId": "E18236120202511231046s1235ee7",
"paidAt": "2025-11-23T10:46:26.986Z",
"createdAt": "2025-11-23T10:45:18.403Z",
"updatedAt": "2025-11-23T10:46:27.346Z",
"callbackUrl": "https://yourwebhook.com",
"infraction": {
"id": "cmide759mb9i3s601bhwf6e",
"protocol": "4dd32924-9b53-4408-af4b-6d3b4d7ac",
"status": "OPEN",
"type": "REFUND_REQUEST",
"reportDetails": "Fraud report: transaction was formally contested by payer",
"reportedBy": "DEBITED_PARTICIPANT",
"analysisResult": null,
"analysisDetails": null,
"reportedAt": "2025-11-24T16:52:15.808Z",
"createdAt": "2025-11-24T17:00:00.490Z",
"updatedAt": "2025-11-24T17:00:00.490Z"
}
}Webhook Integration
When an infraction occurs, your webhook receives the complete transaction object with an infraction field containing:
Infraction Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique infraction identifier |
protocol | string | Payment provider protocol number |
status | InfractionStatus | Current infraction status |
type | InfractionType | Type of infraction |
reportDetails | string | Description of dispute reason |
reportedBy | ReportedBy | Who reported the infraction |
analysisResult | AnalysisResult | null | Final decision (null while pending) |
analysisDetails | string | null | Justification of decision |
reportedAt | string | When it was reported |
expiresAt | string | null | Resolution deadline |
createdAt | string | Creation timestamp |
updatedAt | string | Last update timestamp |
InfractionStatus
| Value | Description |
|---|---|
WAITING_PSP | Waiting for payment provider response |
OPEN | Active and under analysis |
ACKNOWLEDGED | Acknowledged by institution |
DEFENDED | Defense has been submitted |
ANSWERED | Additional information provided |
WAITING_ADJUSTMENTS | Pending documentation |
CLOSED | Resolved with final decision |
CANCELLED | Cancelled before resolution |
InfractionType
| Value | Description |
|---|---|
REFUND_REQUEST | Standard refund request |
FRAUD | Security-related claim |
REFUND_CANCELLED | Cancellation of previous refund |
ReportedBy
| Value | Description |
|---|---|
DEBITED_PARTICIPANT | Reported by payer's institution |
CREDITED_PARTICIPANT | Reported by payee's institution |
AnalysisResult
| Value | Description |
|---|---|
AGREED | Infraction accepted - refund will be processed |
DISAGREED | Infraction rejected - no refund |
Complete Lifecycle of an Infraction
┌──────────────────┐
│ INFRACTION OPEN │
│ status: OPEN │
└────────┬─────────┘
│
┌─────────────────────────────────────┐
│ │
▼ ▼
┌────────────────┐ ┌──────────────────┐
│ ACKNOWLEDGED │ │ DEFENDED │
│ (default) │ │ (if defense sent)│
└────────┬───────┘ └────────┬─────────┘
│ │
└───────────────┬───────────────┘
│
▼
┌──────────────────┐
│ CENTRAL BANK │
│ ANALYSIS │
│ Possible status:│
│ • ANSWERED │
│ • WAITING_ADJ...│
└────────┬─────────┘
│
┌──────────────────────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ CLOSED / AGREED │ │CLOSED / DISAGREED│
│ Automatic │ │ No financial │
│ refund │ │ impact │
└──────────────────┘ └──────────────────┘
Financial Impact
When Infraction is Agreed (AGREED)
Original transaction: COMPLETED
│
▼
Infraction: status CLOSED, result AGREED
│
▼
┌──────────────────────────────────────────┐
│ Transaction changes to: WAITING_FOR_REFUND│
└──────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ Refund initiated AUTOMATICALLY │
│ • Amount debited from your balance │
│ • Fee calculation applied if applicable │
└──────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ Final transaction status: REFUNDED │
│ Completion webhook sent │
└──────────────────────────────────────────┘
When Infraction is Disagreed (DISAGREED)
Transaction: COMPLETED (remains unchanged)
│
▼
Infraction: status CLOSED, result DISAGREED
│
▼
┌──────────────────────────────────────────┐
│ NO FINANCIAL IMPACT │
│ • No refund is processed │
│ • Balance remains the same │
│ • Transaction remains valid │
└──────────────────────────────────────────┘