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

# How it works

> How an Agentcard integration fits together, from the wallet to the money behind it.

An Agentcard integration has four steps. Your server authenticates with us. You connect a user. The user gets a card in their wallet. Then their agent spends, and we send you webhooks so you know what happened.

That's the whole system. The rest of this page covers the concepts, how the money actually moves, and how testing works. When you start wiring it up, [Connect users](/wallet/connect-users) covers the credentials in detail.

## Concepts

* The **Agentcard wallet** stores cards: your users' credit and debit cards, and the Agentcards we issue.
* **Balance** is the money. Users add balance, and balance is what backs an Agentcard.
* **Agentcards** are the cards we issue. The cards users bring themselves are their bank cards.
* **Purchase** is how agents buy things. The endpoint is called `buy`.

## How money moves

When a user adds their own card, there is nothing to prepay. Their agent buys something and the purchase gets charged to their card, like any other charge.

When a user has an Agentcard, the card spends from balance that was added beforehand. It can never spend more than the balance behind it.

In both cases you can set limits on each card, lock a card to a single merchant, and require an approval when a purchase needs a human to say yes.

## Test vs live

There is one API: `api.agentcard.sh`. Whether you are in sandbox or production depends on which credentials you authenticate with, not on the URL.

Sandbox never sends email or SMS, and the verification code is always `111111`. No real money moves. The full list of sandbox tools is in [Test in sandbox](/ship/test-in-sandbox).

When you're ready, the [Quickstart](/get-started/quickstart) walks through all of this with real calls.
