# Disputes (/docs/disputes)

> Pre-release: the public API is not live yet and has no base URL. Routes and fields are in the OpenAPI contract, at /openapi.yaml.

What happens when a payer disputes a PIX at their bank: the amount is held, and the bank decides.

A dispute starts outside the platform: the payer tells their bank that a PIX was a fraud or a mistake, and the bank holds the amount while it decides. In PIX this is the Special Return Mechanism (MED). You do not ask for a dispute and cannot stop one: the platform learns of it from the bank, and tells you.

## What a dispute does [#what-a-dispute-does]

- **The charge becomes `disputed`**, and the `charge.dispute.created` event is sent.
- **The amount leaves your balance at once**, even if you already withdrew it. In that case the balance becomes negative, and the next sales cover it.
- **The fee follows the rule of [refunds](/docs/refunds#the-amount).** By default the platform holds back the fee of the charge together with what the charge left in your balance. In an account set to leave the fee with the platform, the full amount comes out of your balance.
- **A `disputed` charge cannot be refunded.** The answer is `409` with the `charge_disputed` code: the bank decides where the amount goes.

## How it ends [#how-it-ends]

The bank decides, and the `charge.dispute.closed` event is sent either way. Read the charge to see the outcome.

| Outcome | The charge becomes | What happens to the amount |
|---|---|---|
| The bank refuses the dispute | `paid` again | It goes back to your balance |
| The bank accepts the dispute | `refunded`. Final | The bank sends it back to the payer. `charge.refunded` is sent as well |

- A charge that is `paid` again can be refunded, and can be disputed again.
- There is no `charge.paid` event when a dispute is refused: the payment happened once.
- The platform does not send a defense to the bank in this version: the outcome is the one the bank gives.

## Events [#events]

| Event | When | `data.id` |
|---|---|---|
| `charge.dispute.created` | The bank is holding the amount, and the charge became `disputed` | The charge |
| `charge.dispute.closed` | The bank decided, and the charge became `paid` or `refunded` | The charge |
| `charge.refunded` | The charge became `refunded`, together with `charge.dispute.closed`, when the bank accepted the dispute | The charge |

A dispute is not an object of the API: it has no `id` and no route. The charge carries everything you need to act on.

## In test mode [#in-test-mode]

Three operations, available only with a test key, play the part of the banks. See [Test mode](/docs/test-mode#simulating-a-dispute).