> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Issuing a card

> Fund a card, then create it from your server as single-use or multi-use.

Create a virtual card for a user from your server, with your org token and their `user_id`. The card can never spend more than the money behind it.

## Fund the card

Every card draws on a balance, and your company's funding setting says which one. It applies to every card and can't be set per card.

| Setting | Draws on | How the money gets there |
| - | - | - |
| `company_flow` | Your company balance | You add funds in the dashboard, under Wallet. |
| `onramp_flow` | The user's own balance | The user pays with Apple Pay or Google Pay. |

The company balance is the simpler start, because your server never waits on the user to pay. Live company-funded cards need an active subscription. [`GET /api/v2/company_wallet`](https://docs.agentcard.com/api-reference/company-wallet/get) shows what's free to spend.

To have the user fund their own balance, verify their phone once, then create a link:

```bash theme={null}
curl -X POST https://api.agentcard.sh/api/v2/wallet/phone/start \
  -H "Authorization: Bearer $ORG_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "usr_9ae8d0b84fc1008ecb42b232", "phone_number": "+14155550142"}'

curl -X POST https://api.agentcard.sh/api/v2/wallet/phone/verify \
  -H "Authorization: Bearer $ORG_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "usr_9ae8d0b84fc1008ecb42b232", "phone_number": "+14155550142", "code": "111111"}'

curl -X POST https://api.agentcard.sh/api/v2/wallet/fund \
  -H "Authorization: Bearer $ORG_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "usr_9ae8d0b84fc1008ecb42b232", "amount_cents": 5000}'
```

In production the user needs a verified identity before funding, or the request is refused with `kyc_required`. The last response then carries a `checkout_url`. The user opens it and pays in their own browser. In sandbox no one pays: the test money lands right away and the code is always `111111`. The [User balance reference](https://docs.agentcard.com/api-reference/user-balance/overview.md) has the details.

## Create a card

```bash theme={null}
curl -X POST https://api.agentcard.sh/api/v2/cards \
  -H "Authorization: Bearer $ORG_TOKEN" \
  -H "Idempotency-Key: order-1042" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "usr_3305e8868868f3665f6cb0ed", "amount_cents": 2500}'
```

```json theme={null}
{
  "object": "card",
  "id": "card_22943fc47c3865e20527c7a5",
  "status": "open",
  "spend_limit_cents": 2500,
  "balance_cents": 2500,
  "last4": "6803",
  "expiry": "11/28",
  "created_at": "2026-11-02T02:22:03.304Z",
  "type": "single_use",
  "user_id": "usr_3305e8868868f3665f6cb0ed",
  "funds_source": "company_flow",
  "transfer_id": "owt_ca3c70fc335e4ba093851ac4"
}
```

The response never carries the card number. [Read the credentials](https://docs.agentcard.com/issuing/using-the-cards.md#read-the-credentials) when your agent reaches the payment form.

**user\_id** `string` *required*

The connected user the card is for.

**amount\_cents** `number` *required*

What the card can spend, in cents. Minimum 100.

**type** `string`

`single_use` (default) closes after the first approved charge. `multi_use` stays open until its limit is spent, for subscriptions or merchants that charge repeatedly. Optional `expires_at` closes it at that time.

**scope\_preset** `string`

`ai_labs` locks a `multi_use` card to AI-lab merchants (OpenAI, Anthropic, Gemini). Anything else declines at authorization.

Send an `Idempotency-Key` on every create. A retry with the same key returns the same card and spends once, so a timeout never buys two cards. In sandbox, a card funded from a user's balance ignores the key, so each retry creates another test card.

A company-funded card can take up to a minute to fund. Past that, the create answers `202` with `funding_in_progress`. Wait `retry_after_seconds`, then send the same request with the same key to collect the card.

Every card arrives as a `card.created` webhook. The [API reference](https://docs.agentcard.com/api-reference/cards/overview.md) lists every field.

## Handle a refusal

Sandbox returns a test card immediately. In production a create can be refused first, and no money moves:

| `code` | Meaning | What to do |
| - | - | - |
| `kyc_required` | The user has not verified their identity. | [Complete KYC](https://docs.agentcard.com/issuing/completing-a-kyc.md), then retry. |
| `org_wallet_funding_required` | The company balance is short. | Add funds in the dashboard, then retry. |
| `wallet_funding_required` | The user's balance is short. | [Fund their balance](#fund-the-card), then retry. |
| `deposit_confirming` | Money is on the way. | Wait `retry_after_seconds`, then retry. Do not fund again. |

A refusal looks like this:

```json theme={null}
{
  "error": {
    "code": "org_wallet_funding_required",
    "message": "The company balance cannot cover this card. Add funds in the dashboard, then retry.",
    "docs": "https://docs.agentcard.com",
    "required_cents": 9998075,
    "available_cents": 7500
  }
}
```

## Rules for your agent

```text theme={null}
- Confirm with the user before creating a card. Cards are live and charged for real when used.
- Create the card right before the purchase, sized to it. Don't stockpile cards.
- Use multi_use only for merchants that charge repeatedly.
- If the create answers deposit_confirming, wait and retry. Never ask the user to pay twice.
- Your SANDBOX credentials issue test cards that no real merchant accepts.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.