> ## 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.

# Using the cards

> Read a card's credentials at checkout, pay with it, and manage it afterwards.

An issued card works like any card: your agent types the number, expiry and CVC into a merchant's checkout. What is different is what happens around it. Credentials are revealed on demand, single-use cards close themselves, and every charge reaches your server as a webhook.

## Read the credentials

Ask for them when your agent is at the payment form, not before:

```bash theme={null}
curl https://api.agentcard.sh/api/v2/cards/card_22943fc47c3865e20527c7a5/credentials \
  -H "Authorization: Bearer $ORG_TOKEN"
```

```json theme={null}
{
  "object": "card_credentials",
  "id": "card_22943fc47c3865e20527c7a5",
  "number": "…",
  "exp_month": "11",
  "exp_year": "2028",
  "cvc": "…",
  "last4": "6803"
}
```

Never write the number or CVC to logs, error reports, or analytics. Agentcard records every read. To check the balance, [get the card](https://docs.agentcard.com/api-reference/cards/get.md) instead: `balance_cents` is there, and the number isn't.

When the user has asked to approve each reveal, the read is refused with `credentials_protected`. Your server can't read that card.

## Pay

Type the credentials into the checkout. The card authorizes up to its `spend_limit_cents`, and declines anything above it or outside a merchant lock. Your server receives `transaction.authorized` when money moves and `approval.requested` when a purchase needs a human first.

To give your agent a buy tool for the merchants Agentcard already covers, see [Agentcard's Commerce SDK](https://docs.agentcard.com/vault/integrations/ecommerce-apis/purchase-api.md).

## What happens after a charge

* **Single-use cards** close themselves after the first approved charge. `closed_reason` is `used`.
* **Multi-use cards** stay open until their limit is spent or you close them.
* **Refunds** post back to the card that paid. The balance returns to the user.
* **Tokenback:** settled spend earns tokens, 1 token per cent.

## Manage a card

| Request | Does |
| - | - |
| [`GET /api/v2/cards`](https://docs.agentcard.com/api-reference/cards/list) | Lists your company's cards. Filter by `user_id` or `status`. |
| [`GET /api/v2/cards/{card_id}`](https://docs.agentcard.com/api-reference/cards/get) | Reads one card, with its balance and status. |
| [`POST /api/v2/cards/{card_id}/pause`](https://docs.agentcard.com/api-reference/cards/pause) | Blocks new charges on a multi-use card. Reversible. |
| [`POST /api/v2/cards/{card_id}/resume`](https://docs.agentcard.com/api-reference/cards/resume) | Unblocks a paused card. |
| [`PATCH /api/v2/cards/{card_id}`](https://docs.agentcard.com/api-reference/cards/update) | Sets a new limit on a user-funded multi-use card. |
| [`POST /api/v2/cards/{card_id}/topups`](https://docs.agentcard.com/api-reference/cards/top-up) | Raises a company-funded multi-use card from your company balance. |
| [`POST /api/v2/cards/{card_id}/close`](https://docs.agentcard.com/api-reference/cards/close) | Closes the card for good. A second close answers the card again. |

Close a card from your server when the purchase falls through:

```bash theme={null}
curl -X POST https://api.agentcard.sh/api/v2/cards/card_22943fc47c3865e20527c7a5/close \
  -H "Authorization: Bearer $ORG_TOKEN"
```

## Webhooks

Register a [webhook endpoint](https://docs.agentcard.com/api-reference/webhook-endpoints/overview.md) and subscribe to what you need:

| Event | Fires when |
| - | - |
| `card.created` | A card was issued. |
| `transaction.authorized` | A charge was approved on a card. |
| `approval.requested` | A purchase or a reveal is waiting for the user. |
| `identity.verification.updated` | KYC status changed. |

React to webhooks, not to the conversation. The agent saying it paid is a claim. `transaction.authorized` is a fact.

## List your transactions

Read every charge on your company's cards, and every Vault checkout your agents opened, with your platform token:

```bash theme={null}
curl "https://api.agentcard.sh/api/v2/transactions?card_id=card_22943fc47c3865e20527c7a5" \
  -H "Authorization: Bearer $ORG_TOKEN"
```

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "object": "transaction",
      "id": "txn_66cd9314afa46dd6b09c9d40",
      "source": "issued",
      "status": "cleared",
      "amount": 675,
      "currency": null,
      "amount_display": null,
      "merchant_amount": null,
      "merchant_currency": null,
      "merchant": "Blue Bottle Coffee",
      "mcc": "5812",
      "decline_reason": null,
      "user_id": "usr_3305e8868868f3665f6cb0ed",
      "card_id": "card_22943fc47c3865e20527c7a5",
      "vault_card_id": null,
      "last4": "6803",
      "processor_transaction_id": "sandbox_txn_6aa4a425cfc84aa29d893ced6be00c4d",
      "created_at": "2026-11-02T02:22:03.348Z"
    }
  ],
  "cursor": null,
  "has_more": false
}
```

Use the list to reconcile, or to catch up on what your webhook endpoint missed. The `id` is the `transaction_id` a `transaction.*` webhook carries, so an event and its row match. A simulated sandbox charge names no currency, so `currency` and `amount_display` read `null`. The [API reference](https://docs.agentcard.com/api-reference/transactions/overview.md) lists every filter.

## Sandbox

Test cards are issued instantly, carry credentials, and are not accepted by real merchants. Use them to exercise your agent's checkout code against a test storefront such as [shop.agentcard.sh](https://shop.agentcard.sh) on Stripe test mode. The reveal, close and webhook flows are identical to live.

To test what your code does with a charge, simulate one with a sandbox credential. No merchant is involved, and your webhook endpoints get the same events a real charge sends:

```bash theme={null}
curl -X POST https://api.agentcard.sh/api/v2/cards/card_22943fc47c3865e20527c7a5/test_charge \
  -H "Authorization: Bearer $ORG_TOKEN"
```

To walk each step yourself, [place a hold](https://docs.agentcard.com/api-reference/cards/test-authorization.md), then [capture](https://docs.agentcard.com/api-reference/cards/test-capture.md) or [reverse](https://docs.agentcard.com/api-reference/cards/test-reverse.md) it, and [refund](https://docs.agentcard.com/api-reference/cards/test-refund.md) a cleared charge.


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