# Funding your balance

Production operations are paid from a prepaid USD balance that you top up with USDC on Base. In the sandbox you can also use test credit.

## Deposit address

Each organization has one dedicated deposit address per environment. Find it on the console's **Funding** page, or:

```bash
curl "$PACKFLIP_BASE_URL/api/v2/funding/receiving-address" \
  -H "Authorization: Bearer $PACKFLIP_API_KEY"
```

```json
{ "receivingWallet": { "address": "0x…", "chainId": 8453, "asset": "USDC" } }
```

| Environment | Network | Token |
| --- | --- | --- |
| Production | Base (`8453`) | Circle USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
| Sandbox | Base Sepolia (`84532`) | Circle USDC `0x036CbD53842c5426634e7929541eC2318f3dCF7e` |

The address never changes, and every confirmed USDC transfer into it is credited 1 USDC = 1 USD, with no minimum. **Only send that USDC contract on that network.** Other tokens and networks are not credited and may be lost.

## How deposits are credited

1. A transfer reaches the address. Packflip records it as `detected` and emits `balance.topup.detected`.
2. Packflip verifies the receipt on-chain: the right token, the right recipient, and a successful transaction.
3. The deposit becomes `confirmed`, a `TOPUP` ledger entry is added to cash, and `balance.topup.confirmed` is emitted. If verification fails, the deposit becomes `failed` and `balance.topup.failed` is emitted.

Deposits are normally detected within a minute. If one seems missing, scan the address now:

```bash
curl -X POST "$PACKFLIP_BASE_URL/api/v2/funding/refresh" \
  -H "Authorization: Bearer $PACKFLIP_API_KEY"
```

List deposits with `GET /api/v2/funding-transactions`.

## Funding intents (optional)

A funding intent records how much you plan to send, which helps reconcile top-ups on your side. It is not credit and does not reserve anything.

```bash
curl -X POST "$PACKFLIP_BASE_URL/api/v2/funding-intents" \
  -H "Authorization: Bearer $PACKFLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "requestedUsd": "500.00" }'
```

## Sandbox test credit

In the sandbox, `POST /api/v2/sandbox/credits` adds $100 of cash balance without any on-chain transfer. It works once an hour per organization and only tops a balance up to $1,000. A refused request returns `409 conflict`, with a `Retry-After` header when the hourly limit applies. In production the endpoint returns `404`.

You can still test the real deposit flow in the sandbox by sending Base Sepolia USDC, which Circle's faucet provides, to your sandbox deposit address.

## Low balance

An operation that costs more than your spendable balance fails with `409 insufficient_balance` and changes nothing. Watch `GET /api/v2/balance`, or `balance.topup.confirmed` events, and top up before you run out.
