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

# Revert Payout

> Undo a manual mark as paid. The payout returns to pending and its commissions return to ready_for_payment.

Undo a manual mark as paid. Requires `write:payouts` permission.

The operation atomically changes the payout from `completed` to `pending` and linked commissions from `paid` to `ready_for_payment`. Multi-level commissions marked paid with them also revert unless they belong to another completed payout. Refunded, declined, and disputed commissions are left alone. Invoice fields stay unchanged. After reverting, you can delete the payout in the dashboard.

> [!WARNING]
>
> Reverting is rejected when Auto Payouts or Managed Payouts are active for the program, or when the payout was sent by an automatic Stripe or PayPal transfer. This operation changes payment status.

Operation ID: `revertPayout`.

## Path Parameters

**id** `string` *required*

The unique identifier of the payout to revert.

## Body Parameters

The request body is required.

**reason** `string` *required*

Trimmed reason, between 3 and 1000 characters. Stored in the audit log.

**confirm** `boolean` *required*

Must be the literal `true`. Otherwise validation returns: `Set confirm to true to revert this payout`.

## Response

**success** `boolean`

Always `true` for a successful response.

**data** `object`

The pending payout and revert summary.

**Data Object Properties**

**id** `string`

Unique payout identifier.

**affiliate\_id** `string`

Affiliate identifier.

**invoice\_number** `number`

Preserved invoice number.

**amount** `number`

Payout amount.

**status** `string`

Returns `pending`.

**payment\_method** `string | null`

Payment method.

**payment\_reference** `null`

Cleared on revert.

**processed\_at** `null`

Cleared on revert.

**managed\_payout** `boolean`

Whether this is a managed payout.

**affiliate** `object | null`

Affiliate information with `name` and `email`, or null.

**created\_at** `string`

ISO 8601 creation timestamp.

**updated\_at** `string`

ISO 8601 last update timestamp.

**revert** `object`

**Revert Summary**

**reason** `string`

The trimmed audit reason.

**commissions\_reverted** `integer`

Number of linked commissions reverted.

**multi\_level\_commissions\_reverted** `integer`

Number of multi-level commissions reverted.

## Errors

| Status | Error | Description |
| - | - | - |
| 400 | Validation error | Invalid body, reason, or confirmation. |
| 400 | `INVALID_STATUS_TRANSITION` | `Only completed payouts can be reverted. Current status: {status}` |
| 401 | Unauthorized | Authentication required. |
| 403 | Forbidden | Requires `write:payouts`. |
| 404 | Not found | `Payout not found` |
| 409 | `AUTOMATIC_PAYOUTS_ACTIVE` | `Cannot revert a payout while Auto Payouts or Managed Payouts are active for this program.` |
| 409 | `AUTOMATIC_TRANSFER_LOCKED` | `This payout was sent by an automatic transfer and cannot be reverted by a status change.` |
| 409 | `CONFLICT` | Commissions cannot be reverted, for example: `Cannot revert: no linked commission is PAID.` |

> [!NOTE]
>
> A successful revert emits `payout.updated` and `transaction.updated` webhooks, not `payout.paid`.

```bash cURL theme={null}
curl -X POST "https://api.affonso.io/v1/payouts/pay_abc123/revert" \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Marked as paid by mistake",
    "confirm": true
  }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "id": "pay_abc123",
    "affiliate_id": "aff_456def",
    "invoice_number": 1001,
    "amount": 150,
    "status": "pending",
    "payment_method": "bank_transfer",
    "payment_reference": null,
    "processed_at": null,
    "managed_payout": false,
    "affiliate": {
      "name": "John Doe",
      "email": "john@example.com"
    },
    "created_at": "2026-11-30T10:00:00Z",
    "updated_at": "2026-11-30T22:00:00Z",
    "revert": {
      "reason": "Marked as paid by mistake",
      "commissions_reverted": 3,
      "multi_level_commissions_reverted": 1
    }
  }
}
```


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