# Adding funds

Source: https://docs.formance.com/modules/wallets/adding-funds

Stack: v3.2

Add funds to a wallet by issuing a credit via the API. The credit is applied to the wallet's balance immediately.

All amounts use [Universal Monetary Notation](https://docs.formance.com/modules/numscript/monetary-notation) — `USD/2` means US dollars with 2 decimal places, so `100` = $1.00.

## Credit a wallet

The simplest credit — add $1.00 (100 in USD/2) from the default `world` source:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/wallets/<WALLET_ID>/credit" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": {
      "asset": "USD/2",
      "amount": 100
    },
    "sources": [
      {
        "type": "account",
        "identifier": "world"
      }
    ]
  }'
```

fctl

```bash
fctl wallets credit 100 USD/2 --name my-wallet --source account=world
```

## Funding from a specific account

You can fund a wallet from any ledger account — not just `world`. Set the `sources` field to reference the account:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/wallets/<WALLET_ID>/credit" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": {
      "asset": "USD/2",
      "amount": 100
    },
    "sources": [
      {
        "type": "account",
        "identifier": "orders:1234"
      }
    ]
  }'
```

fctl

```bash
fctl wallets credit 100 USD/2 --name my-wallet --source account=orders:1234
```

The source account must have sufficient funds. If it doesn't, the credit will fail with an `INSUFFICIENT_FUND` error.

## Funding from another wallet

You can also fund a wallet from another wallet by using the `wallet` source type:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/wallets/<WALLET_ID>/credit" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": {
      "asset": "USD/2",
      "amount": 100
    },
    "sources": [
      {
        "type": "wallet",
        "identifier": "<SOURCE_WALLET_ID>"
      }
    ]
  }'
```

fctl

```bash
fctl wallets credit 100 USD/2 --name my-wallet --source wallet=<source-wallet-id>
```

## Funding a specific balance

By default, credits go to the `main` balance. To credit a named balance (e.g. a voucher or seasonal balance), include the `balance` field:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/wallets/<WALLET_ID>/credit" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": {
      "asset": "COIN",
      "amount": 50
    },
    "balance": "season-2024",
    "sources": [
      {
        "type": "account",
        "identifier": "world"
      }
    ]
  }'
```

fctl

```bash
fctl wallets credit 50 COIN --name my-wallet --balance season-2024 --source account=world
```
