# Wallets and FX

Every account has one **settlement** wallet per currency. You can add **working** wallets to
keep funds separate, for example per branch or per product.

## List and create wallets

```bash
curl https://api.intasend.com/api/v1/wallets/?currency=KES \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY"

curl -X POST https://api.intasend.com/api/v1/wallets/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label": "Nairobi branch", "currency": "KES", "wallet_type": "WORKING", "can_disburse": true}'
```

| Field | Description |
|---|---|
| `label` | Required. Must be unique per currency |
| `currency` | `KES`, `USD`, `EUR`, `GBP`, `GHS`, `NGN`, `UGX`, `TZS`, `XAF`, `XOF`, `RWF`, `CDF` |
| `wallet_type` | `WORKING`. Settlement wallets are created automatically |
| `can_disburse` | Allow payouts from this wallet |

A wallet object contains `wallet_id`, `label`, `currency`, `wallet_type`, `can_disburse`,
`current_balance`, `available_balance` and `updated_at`. `available_balance` excludes funds still clearing.

## Move funds between wallets

```bash
curl -X POST https://api.intasend.com/api/v1/wallets/{wallet_id}/intra_transfer/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"wallet_id": "DESTINATION_WALLET_ID", "amount": 500, "narrative": "Float top-up"}'
```

Both wallets must be the same currency. The response contains the updated `origin` and `destination` wallets.

## Convert currency

Get a quote, then exchange. Both source and destination must be settlement wallets.

```bash
curl -X POST https://api.intasend.com/api/v1/wallets/{wallet_id}/exchange/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"currency": "USD", "amount": 10000, "action": "QUOTE"}'
# → {"rate": ..., "fxe_amount": ..., "currency": "USD"}
```

Send the same request with `"action": "EXCHANGE"` to convert.

Indicative rates are public:

```bash
curl "https://api.intasend.com/api/v1/realtime-fx-rates/exchange/?base=KES&currency=USD"
# → {"rate": "0.00775"}
```

## Transactions

```bash
curl "https://api.intasend.com/api/v1/wallets/{wallet_id}/transactions/" \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY"
```

Use `GET /api/v1/transactions/` for all wallets. It can be filtered by `start_date`, `end_date`, `currency`, `trans_type` and `narrative`.

| `trans_type` | |
|---|---|
| `SALE` | Collected payment |
| `PAYOUT` | Send money |
| `CHARGE` | Fees |
| `DEPOSIT`, `WITHDRAWAL`, `EXCHANGE`, `SPLIT`, `AIRTIME`, `RESERVE`, `ADJUSTMENT` | |

A transaction's `status` is one of `AVAILABLE`, `CLEARING`, `ON-HOLD`, `CANCELLED`, `CHARGEBACK-PENDING`, `REFUNDED` or `ADJUSTMENT`.

List endpoints are paginated (100 per page) and return `{"count", "next", "previous", "results"}`.
