# Spending funds

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

Stack: v3.2

Spend funds from a wallet by issuing a debit. The debit reduces the wallet's balance immediately.

## Basic debit

Debit $1.00 from a wallet. By default, funds go to the `world` account (representing the outside world):

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/wallets/<WALLET_ID>/debit" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": {
      "asset": "USD/2",
      "amount": 100
    }
  }'
```

fctl

```bash
fctl wallets debit 100 USD/2 --name my-wallet
```

## Setting the destination

Send debited funds to a specific ledger account instead of `world`:

curl

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

fctl

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

## Sending to another wallet

You can also send funds directly to another wallet:

curl

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

fctl

```bash
fctl wallets debit 100 USD/2 --name my-wallet --destination wallet=<target-wallet-id>
```

The wallet must have sufficient funds. If it doesn't, the debit fails with an `INSUFFICIENT_FUND` error.
