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

# Programs & Accounts

> Define card products and the funding that backs them.

## Programs

A **program** is a card product definition. It sets the product type and currency for the cards issued under it.

| Field         | Values                        |
| ------------- | ----------------------------- |
| `productType` | `DEBIT`, `PREPAID`, `CREDIT`  |
| `currency`    | ISO currency code, e.g. `USD` |
| `status`      | `ACTIVE`, `PAUSED`, `CLOSED`  |

```bash cURL theme={null}
curl -s -X POST 'https://sandbox.apocor.ai/v1/programs' \
  -H 'Authorization: Bearer YOUR_TOKEN' -H 'Content-Type: application/json' \
  -d '{ "name": "USD Virtual Debit", "product_type": "DEBIT", "currency": "USD" }'
```

<Note>
  The underlying issuing rail is chosen and managed by Apocor. It is an implementation detail and never appears in your API responses.
</Note>

## Accounts

An **account** holds funds and backs the cards issued under a program. **Create an account before issuing cards** — card issuance references `account_id` and provisions issuer-side funding on first use.

```bash cURL theme={null}
curl -s -X POST 'https://sandbox.apocor.ai/v1/accounts' \
  -H 'Authorization: Bearer YOUR_TOKEN' -H 'Content-Type: application/json' \
  -d '{ "program_id": "prog_abc123", "currency": "USD" }'
```

### Balances

Balances are reported in **minor units** (cents). `available` is what's spendable after holds.

```bash cURL theme={null}
curl -s 'https://sandbox.apocor.ai/v1/accounts/acct_abc123/balance' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

```json theme={null}
{ "data": { "available": 48000, "ledger": 50000, "held": 2000 } }
```

| Field       | Meaning                        |
| ----------- | ------------------------------ |
| `ledger`    | Settled balance                |
| `held`      | Authorized but not yet cleared |
| `available` | `ledger − held`                |
