> ## 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.

# 出金のステータスと冪等性

> 出金のステータス、ステータスの遷移、作成 API の冪等性ルール。

## ステートマシン

Payout status: IN\_PROGRESS to SUCCESS or FAILURE

開始
終了
最終状態

| status | 説明 | 最終状態 |
| - | - | - |
| `IN_PROGRESS` | 出金は受け付けられ、処理中です。送金先の Payout チャネルによっては、この状態が長く続くことがあります。 | いいえ |
| `SUCCESS` | 出金が完了し、資金が受取人に届きました。 | はい |
| `FAILURE` | 出金に失敗しました。資金は加盟店アカウントに返却されます。Waffo にすでに発生した費用と契約条件に基づき、失敗手数料が差し引かれることがあります。 | はい |

`status` は、[Payout create](https://waffo.com/docs/api-reference/payout-create/payout-create.md) のレスポンス、[Payout inquiry](https://waffo.com/docs/api-reference/payout-inquiry/payout-inquiry.md) のレスポンス、[PAYOUT\_NOTIFICATION](https://waffo.com/docs/ja/developer-docs/webhook/event-types.md#payout_notification) 通知で返されます。

* `SUCCESS` と `FAILURE` は最終状態です。最終状態になった出金のステータスは変わりません。
* 作成レスポンスは通常 `IN_PROGRESS` を返します。リクエストが拒否された場合はエラーコードが返され（[出金エラーコード](https://waffo.com/docs/api-reference/ja/payout/error-codes.md)を参照）、出金通知は送信されません。
* `IN_PROGRESS` が長く続いても失敗として扱わないでください。出金を照会するか、通知を待ってください。

## 冪等性

`payoutRequestId` は [Payout create](https://waffo.com/docs/api-reference/payout-create/payout-create.md) の冪等キーで、加盟店アカウント内で一意である必要があります。

リクエストの `payoutRequestId` がすでに存在する場合、Waffo は新しい出金を作成せず、次のフィールドを既存の出金と比較します。

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

| 比較結果 | 処理 |
| - | - |
| すべて一致 | 既存の出金と現在のステータスを返します。`payoutOrderId` は変わらず、出金が二重に送信されることはありません。 |
| いずれかが異なる | `A0011`（HTTP 400）でリクエストを拒否します。新しい出金は作成されず、既存の出金も変わりません。 |


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