# Holding and confirming

Source: https://docs.formance.com/modules/wallets/holding-confirm

Stack: v3.2

In some cases you want to reserve funds before confirming the debit — for example, holding funds while an order is being shipped, then confirming once it's delivered.

## Create a hold

Issue a debit with `pending: true` to create a hold. The funds are reserved but not yet spent:

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
    },
    "pending": true
  }'
```

fctl

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

The response includes a `hold` field with the hold ID. Use this ID to confirm or void the hold.

## Confirm the hold

Once the event is confirmed (e.g. order shipped), confirm the hold to finalize the debit:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/holds/<HOLD_ID>/confirm" \
  -H "Content-Type: application/json" \
  -d '{
    "final": true
  }'
```

fctl

```bash
fctl wallets holds confirm <hold-id> --final
```

## Void the hold

If the event doesn't happen (e.g. order cancelled), void the hold to release the funds back to the wallet:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/holds/<HOLD_ID>/void"
```

fctl

```bash
fctl wallets holds void <hold-id>
```

## Partial confirmation

You can confirm only part of a hold. For example, if you held $1.00 but only need to charge $0.75:

curl

```bash
curl -X POST "$FORMANCE_API_URL/api/wallets/holds/<HOLD_ID>/confirm" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 75,
    "final": true
  }'
```

fctl

```bash
fctl wallets holds confirm <hold-id> --amount 75 --final
```

The remaining $0.25 is automatically released back to the wallet when `final: true` is set.

Without `final: true`, partial confirmations leave the hold open — you can confirm additional amounts later until you finalize it.
