1. Get your credentials
You need an Agentcard organizationclient_id and client_secret. Create them in the dashboard and exchange them for an access token:
$ORG_TOKEN below. Sandbox credentials create sandbox sessions and sandbox authorizations, so start there.
2. Store a card
Create a vault session and send the user the link wherever you already talk to them: iMessage, WhatsApp, your app.vault.session_linked webhook with their user_id, or you poll the session until its status is linked. Store that user_id, you need it on every purchase.
For a test run, store a test card: any of Stripe’s published test cards, any future expiry, any CVC.
More on adding cards →
3. Attach Agentcard to your browser
Install the SDK next to your browser provider. This example uses KERNEL; Browserbase and any CDP browser work the same way.4. Complete the purchase
Let your agent shop as usual. At checkout it should fill the card form with placeholder data, any of Stripe’s published test cards, and submit. The Agentcard SDK intercepts the processor request and pauses it.onApprovalUrl fires with a link; send it to the user. They approve with their passkey, their device sends the real card to the processor, and the paused request resumes with the real response.
Then confirm the order with the merchant before you tell the user anything:
Try it against a store that always works
shop.agentcard.sh is a demo store on Stripe test mode, kept running for exactly this rehearsal. Add a product, submit the card form with the placeholder card, approve on the device that holds your passkey, and the order completes with a real test-mode charge.Keep going
Adding a card
Open vs connected sessions, webhooks vs polling, returning users.
Creating a cart
Browsers, SDK options, and the Purchase API alternative.
Completing a purchase
Approval, reconciliation, webhooks, supported processors.
Set rules on a card
Optional rules for one of a user’s cards: a spend cap, a merchant list, a currency, a time window.