# Infractions (MED) (/en/docs/pix-processamento/tutoriais/infractions)

<QuickLinks>
  <QuickLink href="/docs/pix-processamento/med" title="MED, full overview" />

  <QuickLink href="/docs/pix-processamento/endpoints/infractions/get_infractions" title="GET /user/infractions" method="GET" path="/user/infractions" />

  <QuickLink href="/docs/pix-processamento/endpoints/infractions/post_infractions_defense" title="POST defense" method="POST" path="/defenses" />

  <QuickLink href="/docs/pix-processamento/webhooks" title="Webhooks" />
</QuickLinks>

<Mermaid
  chart="`
flowchart LR
  A[&#x22;Payer contests&#x22;] --> B[&#x22;Callback with infraction&#x22;]
  B --> C[&#x22;GET /user/infractions/{id}&#x22;]
  C --> D{&#x22;Decide&#x22;}
  D -->|&#x22;Defend&#x22;| E[&#x22;POST .../defenses&#x22;]
  D -->|&#x22;Wait&#x22;| F[&#x22;Bacen analyzes&#x22;]
  E --> F
  F --> G{&#x22;Decision&#x22;}
  G -->|&#x22;AGREED&#x22;| H[&#x22;Transaction REFUNDED&#x22;]
  G -->|&#x22;DISAGREED&#x22;| I[&#x22;Transaction upheld&#x22;]

  click B &#x22;/en/docs/pix-processamento/webhooks&#x22; &#x22;Callback with infraction&#x22;
  click C &#x22;/en/docs/pix-processamento/endpoints/infractions/get_infractions_by_id&#x22; &#x22;GET detail&#x22;
  click E &#x22;/en/docs/pix-processamento/endpoints/infractions/post_infractions_defense&#x22; &#x22;POST defense&#x22;
  click H &#x22;/en/docs/pix-processamento/med&#x22; &#x22;MED&#x22;
  click I &#x22;/en/docs/pix-processamento/med&#x22; &#x22;MED&#x22;

  style A fill:#f59e0b,stroke:#d97706,color:#ffffff
  style H fill:#ef4444,stroke:#dc2626,color:#ffffff
  style I fill:#14ce71,stroke:#0eb464,color:#ffffff
`"
/>

When a received charge becomes a MED dispute, PayZu creates an **infraction** and you can submit a defense via API. What the MED is, deadlines and full lifecycle in [MED, full overview](/docs/pix-processamento/med).

<Callout type="warn">
  The response deadline is set by Bacen, usually **72h**. Without a defense within the deadline, the amount may be refunded automatically. Configure an internal alert when receiving the callback with `infraction`.
</Callout>

## List infractions [#list-infractions]

```bash
curl "https://api.payzu.processamento.com/v1/user/infractions?status=OPEN&page=1&limit=50" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json"
```

Schema at [`GET /user/infractions`](/docs/pix-processamento/endpoints/infractions/get_infractions).

## Infraction detail [#infraction-detail]

Returns reason, contested amount, deadline and the related transaction.

```bash
curl "https://api.payzu.processamento.com/v1/user/infractions/INFRACTION_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json"
```

Schema at [`GET /user/infractions/{id}`](/docs/pix-processamento/endpoints/infractions/get_infractions_by_id).

## Submit defense [#submit-defense]

```bash
curl -X POST "https://api.payzu.processamento.com/v1/user/infractions/INFRACTION_ID/defenses" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

Schema at [`POST .../defenses`](/docs/pix-processamento/endpoints/infractions/post_infractions_defense).

<Callout type="info">
  The body schema for this operation is not published in the public spec. To submit a defense with justification and attachments, contact support to confirm the fields.
</Callout>

## Track defenses [#track-defenses]

List all submitted defenses:

```bash
curl "https://api.payzu.processamento.com/v1/user/infractions/INFRACTION_ID/defenses" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json"
```

Schema at [`GET .../defenses`](/docs/pix-processamento/endpoints/infractions/get_infractions_defenses) and [`GET .../defenses/{defenseId}`](/docs/pix-processamento/endpoints/infractions/get_infractions_defense_by_id).

## Best practices [#best-practices]

* **Automatic alert when receiving `infraction` in the callback**, the deadline is short.
* **Persist the infraction's `expiresAt`** and create a scheduled task.
* **Keep evidence** (DICT logs before the payment, receipt, conversation with customer), it makes the defense easier.
* **Accept or contest quickly**, silence is usually interpreted as acceptance.

The values for `status`, `type`, `reportedBy` and analysis result are in the [Glossary](/docs/pix-processamento/glossary).

## Next steps [#next-steps]

<QuickLinks>
  <QuickLink href="/docs/pix-processamento/tutoriais/receive-pix" title="Receive Pix" />

  <QuickLink href="/docs/pix-processamento/webhooks" title="Webhooks" />
</QuickLinks>

## Need help? [#need-help]

<QuickLinks>
  <QuickLink href="https://suporte.payzu.com.br/portal/pt-br/newticket?departmentId=1103699000000006907&layoutId=1103699000000074011" title="Open ticket" />
</QuickLinks>