# Balances

Read the money you can pay out, and the card money Payd is still holding.

<div class="endpoint"><span class="method get">GET</span><code>https://api.payd.money/api/v1/balances/accounts/{account_id}</code></div>

`account_id` is your [account id](./authentication.md#find-your-account-id). A key can only read its own account. Any other id returns `403` `permission_denied`.

::: code-group

```bash [cURL]
curl https://api.payd.money/api/v1/balances/accounts/4f28836c-2f1e-4d9b-9a51-6f3c2b1d8e70 \
  -u "$PAYD_API_USERNAME:$PAYD_API_PASSWORD"
```

```js [Node.js]
const auth = Buffer.from(
  `${process.env.PAYD_API_USERNAME}:${process.env.PAYD_API_PASSWORD}`,
).toString('base64')

const { balance } = await fetch(
  `https://api.payd.money/api/v1/balances/accounts/${process.env.PAYD_ACCOUNT_ID}`,
  { headers: { Authorization: `Basic ${auth}` } },
).then((r) => r.json())

console.log(`Available: ${balance.balance} USD (${balance.converted_balance} ${balance.currency})`)
```

```python [Python]
import os
import requests

res = requests.get(
    f"https://api.payd.money/api/v1/balances/accounts/{os.environ['PAYD_ACCOUNT_ID']}",
    auth=(os.environ["PAYD_API_USERNAME"], os.environ["PAYD_API_PASSWORD"]),
    timeout=15,
)
res.raise_for_status()
balance = res.json()["balance"]
print(f"Available: {balance['balance']} USD ({balance['converted_balance']} {balance['currency']})")
```

:::

## Response

```json
{
  "balance": {
    "balance": 418.32,
    "converted_balance": 54005.11,
    "currency": "KES",
    "conversion_rate": 129.1,
    "inflight_balance": 19.37,
    "converted_inflight_balance": 2500.67
  },
  "onchain_balance": {
    "balance": 0,
    "converted_balance": 0,
    "currency": "USD",
    "conversion_rate": 1,
    "inflight_balance": 0,
    "converted_inflight_balance": 0
  }
}
```

### `balance`

Your main balance, which payouts use by default (`wallet_type` `fiat`).

| Field | Meaning |
| --- | --- |
| `balance` | Money you can pay out, in US dollars. |
| `inflight_balance` | Card money Payd is holding before it [settles](./card-payments.md#settlement), in US dollars. |
| `currency` | Your account currency. The `converted_*` fields use it. |
| `conversion_rate` | Units of `currency` per US dollar, used for the converted figures. |
| `converted_balance` | `balance` in your account currency. |
| `converted_inflight_balance` | `inflight_balance` in your account currency. |

### `onchain_balance`

Your crypto balance, used by payouts that send `wallet_type` `crypto`. `balance` is in US dollars. The other fields work as above. Most accounts can ignore it.

## Tips

- Convert with `conversion_rate` for display only. Payouts are charged at the rate on the day, so [quote a payout](./quotes.md) to know what it will cost.
- Payd charges fees in US dollars. A payout needs `balance` to cover the amount and the fee.
- A new account with no money yet returns zeros.
