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

# Funding Sources

> Bind and update internal accounts as card funding sources

A card's `fundingSource` is the internal account that Authorization
Decisioning pulls from when an authorization arrives. Every card is bound to
one funding source.

## At issue time

Supply `fundingSource` when you create the card with `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 internal account must:

* Belong to the customer.
* Be denominated in a card-eligible currency.

The card's `currency` is derived from the funding source at issue time. If the
account does not qualify, Grid rejects the request with
`400 FUNDING_SOURCE_INELIGIBLE`.

## Replace the funding source

Supply a different `fundingSource` with `PATCH /cards/{id}` to replace the
account that funds the card:

```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 customer and be denominated in the
card's currency. The response returns the updated `Card` resource. Changing
`fundingSource` does not fire a webhook.

You cannot supply `fundingSource` alongside `status: CLOSED`. To stop a card
from spending, set `status: FROZEN` instead.

### Errors

| Status | Code                        | What it means                                                                                                                                   |
| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `FUNDING_SOURCE_INELIGIBLE` | The account does not belong to the customer or is not denominated in a card-eligible currency at creation or the card's currency when replaced. |
| 400    | `INVALID_INPUT`             | `fundingSource` was supplied alongside `status: CLOSED`, or another request field is invalid.                                                   |
| 409    | `CARD_NOT_MUTABLE`          | The card is `CLOSED`.                                                                                                                           |

## Stop a card from spending

Freeze the card without changing its funding source:

```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 '{ "status": "FROZEN" }'
```

To permanently retire a card, close it with `PATCH /cards/{id}` and
`status: "CLOSED"`.
