# Moving money

Payments go to recipients; withdrawals go to your own accounts. Both reserve funds at once, follow the approval policy and limits, and report progress by webhook.


## Payments versus withdrawals

| | Payment | Withdrawal |
| --- | --- | --- |
| Goes to | A third-party recipient's account | One of the organization's own accounts elsewhere |
| Call | `POST /v1/orgs/{orgId}/payments` (Send a payment) | `POST /v1/orgs/{orgId}/withdrawals` (Withdraw to your own account) |
| Permission | `payments:create` | `withdrawals:create` |
| Wrong destination | `own_account` | `not_own_account` |
| Event | `payment.updated` | `withdrawal.updated` |

Own accounts are stored as a hidden "self" recipient. They appear under own accounts, never in the recipient list.

## The flow


1. **Recipient.** Add the recipient with a bank account or wallet (`POST /v1/orgs/{orgId}/counterparties` (Add a recipient)). It is screened: `clear`, `review` or `blocked`.
2. **Quote.** `POST /v1/orgs/{orgId}/payments/quote` (Quote a payment) prices each rail: ACH, same-day ACH, wire, FedNow, or on-chain. Each option has a fee and an arrival time.
3. **Create.** `POST /v1/orgs/{orgId}/payments` (Send a payment) with an `Idempotency-Key`. The amount plus fee is **reserved** at once.
4. **Approve** if needed. Above the organization's threshold the payment waits in `pending_approval` until enough approvers approve it. The creator can't approve their own unless the policy allows it.
5. **Track.** The payment moves to `processing` at the partner, then `completed`, or `failed`, or later `returned`. Each change sends `payment.updated`.


## Statuses

| Status | Meaning | Funds |
| --- | --- | --- |
| `pending_approval` | Waiting for approvers | Reserved |
| `approved` | About to be sent | Reserved |
| `processing` | At the banking partner | Reserved |
| `completed` | Delivered. Final. | Debited |
| `failed` | The partner could not send it | Released |
| `canceled` | Canceled or rejected before sending | Released |
| `returned` | Sent, then returned by the receiving bank | Credited back |

## Idempotency

Every money-moving POST takes an `Idempotency-Key` header. Use one key per intended payment, and store it with your record:

- same key, same body: you get the original payment back (safe retry after a timeout)
- same key, different body: `idempotency_mismatch`
- no key: `idempotency_key_required`

## Limits and fees

Payezy sets each organization's single-transfer and daily limits inside a hard ceiling; `GET /v1/orgs/{orgId}/payment-limits` (Get payment limits) shows them and today's usage. Fees appear on the quote and the payment. Platforms see Payezy's share and the network's share separately.

Guided journey: Failure lab: what goes wrong, and how to recover