> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simplepay.mx/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and reconcile refunds

> Create idempotent refunds and retrieve their status from the API.

A refund is a financial resource separate from its payment. Store its ID and reconcile changes through the API and webhooks.

## Check the command

Before creating a refund, verify:

* The payment belongs to the same merchant and environment
* The amount does not exceed the refundable balance
* The command has an idempotency key
* The key includes `refunds:write`

A `2xx` accepts or creates the resource, but settlement may remain pending. Process `refund.created`, `refund.updated`, `refund.succeeded`, and `refund.failed`.

Reuse the same `Idempotency-Key` after a timeout. Do not create another key until you know the prior command's outcome.
