> ## Documentation Index
> Fetch the complete documentation index at: https://ramps-09-11-convert-funding-sources-to-funding-source.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Funding Source

> Bind and replace the internal account that funds a card

A card's `fundingSource` is the internal account Authorization Decisioning
pulls from when an auth lands. Every card is bound to exactly one. This page
covers binding at issue time and replacing the binding via
`PATCH /cards/{id}`.

## At issue time

You supply `fundingSource` on `POST /cards`.

```bash theme={null}
curl -X POST "$GRID_BASE_URL/cards" \
  -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
    "form": "VIRTUAL",
    "fundingSource": "InternalAccount:019542f5-b3e7-1d02-0000-000000000002"
  }'
```

The account must:

* Belong to the cardholder (no cross-customer funding in v1).
* Be denominated in a card-eligible currency (USDB in v1).

The card's `currency` is derived from the funding source at issue time. The
funding source also selects the card issuer, and therefore the card's
`cardCapabilities`. If the account fails these checks, the request is
rejected with `400 FUNDING_SOURCE_INELIGIBLE`.

## Replacing the binding

`PATCH /cards/{id}` accepts a `fundingSource` field that replaces the
account the card draws on.

```bash theme={null}
curl -X PATCH "$GRID_BASE_URL/cards/Card:019542f5-b3e7-1d02-0000-000000000010" \
  -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "fundingSource": "InternalAccount:019542f5-b3e7-1d02-0000-000000000003"
  }'
```

The replacement account must belong to the cardholder and be denominated in
the card's currency. The response is `200 OK` with the updated `Card`.

On card programs where the card issuer makes the authorization decision,
`fundingSource` cannot be combined with a `state` change — send them as
separate requests. Where Grid makes the decision, the combination is valid
for any `state` change other than `CLOSED`.

### Errors

| Status | Code                        | What it means                                                                                                                                             |
| ------ | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `FUNDING_SOURCE_INELIGIBLE` | The account doesn't belong to the cardholder or isn't denominated in the card's currency.                                                                 |
| 400    | `INVALID_INPUT`             | `fundingSource` was supplied alongside `state: CLOSED`, or combined with a `state` change on a card program where the card issuer decides authorizations. |
| 409    | `CARD_NOT_MUTABLE`          | The card is `CLOSED`.                                                                                                                                     |

## Stopping a card from spending

A card always has a funding source — you cannot unbind one. To stop a card
from spending without changing what funds it, transition it to `FROZEN`:

```bash theme={null}
curl -X PATCH "$GRID_BASE_URL/cards/Card:019542f5-b3e7-1d02-0000-000000000010" \
  -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "state": "FROZEN" }'
```

To permanently retire a card, close it with `PATCH /cards/{id}` and
`state: "CLOSED"`. Closing detaches the funding source; `fundingSource`
cannot be supplied in the same request.
