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

# Programs & Products

> A program is the contractual envelope for card issuance. Products are the card templates defined within a program — currency, network, limits, 3DS. Cards inherit all settings from their product.

# Programs & Products

## How It Fits Together

```
Business
├── Programs  (contractual envelope — one per agreement with FYATU)
│   └── Products  (card templates — up to 5 per program)
│       └── Cards  (inherit all settings from the product)
│
├── Cardholders  (business-level — not linked to any program)
└── Transactions  (business-level — spans all programs)
```

Cardholders and Transactions are owned by the **Business**, not by a specific Program. A single cardholder can hold cards under different programs simultaneously. When a program is paused or closed, the cardholder is unaffected — they can receive cards from another program if one is available.

***

## Programs

A **program** is the contractual and regulatory container negotiated between your business and FYATU. It establishes the card network (Visa or Mastercard), the base currency, the program ledger, and the top-level compliance rules.

Programs are created and configured exclusively by the FYATU team. You read and monitor them via the API.

### Program Statuses

| Status   | Description                                                          |
| -------- | -------------------------------------------------------------------- |
| `ACTIVE` | Fully operational — products can issue cards                         |
| `PAUSED` | Temporarily suspended — new cards blocked, existing cards unaffected |
| `CLOSED` | Permanently closed — no new operations permitted                     |

### The Program Ledger

Every program holds a pre-funded balance — the **program ledger** — that backs all card funding operations.

```
You top up the ledger via the portal
              │
              ▼
        Program ledger
              │
    ┌─────────┴──────────┐
    │                    │
POST /cards/{id}/fund   POST /cards/{id}/unload
POST /cards/{id}/terminate (refund)
    │                    │
    ▼                    ▼
  Card balance     Card balance
```

Every `POST /cards/{id}/fund` debits the program ledger and credits the card. Unloading or terminating a card returns balance to the ledger. No money leaves FYATU via the API — withdrawals go through the portal.

**Low balance alert:** when the ledger drops below `lowBalanceThreshold`, a `PROGRAM_BALANCE_LOW` webhook fires. Subscribe to it to automate top-up alerts.

<Warning>
  If the program ledger reaches zero, `POST /cards/{id}/fund` will fail with `INSUFFICIENT_PROGRAM_BALANCE`. Cards already funded continue to work — spending draws from the card's own balance.
</Warning>

***

## Products

A **product** is a card template defined within a program. It encodes everything that is fixed at card issuance: the card scheme, currency, spending limits, 3DS, and tokenization settings. **When you issue a card, you specify a `productId` — all card settings are inherited from the product automatically.**

```
Program: Visa USD Agreement
└── Products:
    ├── "Visa USD Standard"   — $5,000 limit, 3DS on, tokenization off
    ├── "Visa USD Premium"    — $20,000 limit, 3DS on, tokenization on (Apple/Google Pay)
    └── "Visa USD Restricted" — $500 limit, no 3DS, JIT funding enabled
```

A program can have up to **5 products**. Products are created in the CaaS portal by the FYATU team.

### Product Fields

| Field                   | Description                                               |
| ----------------------- | --------------------------------------------------------- |
| `productId`             | Unique product identifier — pass this to `POST /cards`    |
| `name`                  | Product name (e.g. "Visa USD Standard")                   |
| `scheme`                | `VISA` or `MASTERCARD`                                    |
| `currency`              | ISO 4217 currency for cards under this product            |
| `type`                  | Card form factor: `VIRTUAL`                               |
| `transactionLimit`      | Maximum single transaction amount                         |
| `dailyLimit`            | Daily spending cap                                        |
| `monthlyLimit`          | Monthly spending cap                                      |
| `is3DSEnabled`          | Whether 3D Secure is enabled for cards under this product |
| `isTokenizationEnabled` | Apple Pay / Google Pay support                            |
| `isJITEnabled`          | Just-In-Time funding mode                                 |
| `status`                | `ACTIVE` or `INACTIVE`                                    |

### Discovering Available Products

Before issuing cards, list the products available in a program:

```bash theme={null}
curl https://api.fyatu.com/api/v3.20/programs/prg_01HXYZ.../products \
  -H "Authorization: Bearer $FYATU_API_KEY"
```

Then use the `productId` when creating cards:

```json theme={null}
POST /cards
{
  "cardholderId": "chl_01HXYZ1234ABCDEF5678",
  "productId":    "prd_01HXYZABC123"
}
```

### Feature Flag Immutability

Once any cards have been issued under a product, the feature flags (`is3DSEnabled`, `isTokenizationEnabled`, `isJITEnabled`) become immutable. These settings are baked into the card at the provider level and cannot be changed retroactively. To change feature flags, create a new product and issue future cards against it.

***

## Amount Representation

All monetary amounts in the CaaS API are returned as both a raw integer (`cents`) and a display string (`displayValue`):

```json theme={null}
"spendingLimitPerCard": {
  "cents":        500000,
  "displayValue": "5000.00"
}
```

Use `cents` for arithmetic and comparisons. Use `displayValue` for display only. Fund and unload operations accept a `float` dollar amount in the request body (e.g. `50.00` for fifty dollars).

***

## Endpoints

* `GET /programs` — [List programs](/v3.20/api-reference/programs/list)
* `GET /programs/{id}` — [Get program](/v3.20/api-reference/programs/get)
* `GET /programs/{programId}/products` — [List products in a program](/v3.20/api-reference/programs/products)

<Note>
  Programs and Products are read-only from the API. Configuration changes (limits, feature flags, new products) are made in the CaaS portal by the FYATU team.
</Note>
