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

# Payout status and idempotency

> Payout status, status transitions and the idempotency rule of Payout create.

## State machine

Payout status: IN\_PROGRESS to SUCCESS or FAILURE

Start
End
Final status

| status | Description | Final |
| - | - | - |
| `IN_PROGRESS` | The payout has been accepted and is being processed. A payout may stay in this status for as long as the destination rail requires. | No |
| `SUCCESS` | The payout was completed and the funds were delivered to the payee. | Yes |
| `FAILURE` | The payout failed. The funds are returned to your merchant account. A failure fee may be deducted, based on the costs Waffo has already incurred and the terms of your contract. | Yes |

`status` is returned in the [Payout create](https://waffo.com/docs/api-reference/payout-create/payout-create.md) response, the [Payout inquiry](https://waffo.com/docs/api-reference/payout-inquiry/payout-inquiry.md) response and the [PAYOUT\_NOTIFICATION](https://waffo.com/docs/en/developer-docs/webhook/event-types.md#payout_notification) notification.

* `SUCCESS` and `FAILURE` are final. Once a payout reaches a final status, its status never changes again.
* The create response usually returns `IN_PROGRESS`. When the request is rejected, a [Payout error code](https://waffo.com/docs/api-reference/payout/error-codes.md) is returned instead, and no payout notification is sent.
* Never treat a long-running `IN_PROGRESS` as a failure. Query the payout, or wait for the notification.

## Idempotency

`payoutRequestId` is the idempotency key of [Payout create](https://waffo.com/docs/api-reference/payout-create/payout-create.md). It must be unique within your merchant account.

When a request carries a `payoutRequestId` that already exists, Waffo does not create a new payout. It compares these fields with the existing payout:

* `payoutAmount`
* `payoutCurrency`
* `payoutInfo.payoutMethodUserAccountNo`

| Result | What happens |
| - | - |
| All fields match | Waffo returns the existing payout with its current status. `payoutOrderId` stays the same and the payout is never submitted twice. |
| Any field differs | The request is rejected with `A0011` (HTTP 400). No new payout is created and the existing one is unchanged. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.