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

# Agentcard

> Attach Agentcard checkout to a hosted Notte browser.

> [!TIP]
>
> Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.

Use the TypeScript helper in [`examples/agentcard`](https://github.com/nottelabs/notte/tree/main/examples/agentcard) to attach Agentcard's Vault SDK to the dedicated context of a newly created Notte session.

## Set up

Use Node.js 24+, a [Notte API key](https://console.notte.cc/apikeys), and sandbox credentials from the [Agentcard dashboard](https://app.agentcard.sh). Follow the [Vault quickstart](https://docs.agentcard.com/vault/quickstart) to link a test card and obtain its user ID.

Open `examples/agentcard` and run `npm ci`. Create an `Agentcard` client from `@agent-cards/sdk`, then pass it to `runCheckout` with your merchant, amount, currency, and user ID.

Your application supplies three callbacks: `purchase` drives the merchant checkout, `onApprovalUrl` delivers the approval link privately, and `readMerchantOrder` checks the merchant's order result. The helper blocks service workers and attaches the SDK before checkout actions run, so the SDK can pause the card request. Approval links and payment details must stay out of ordinary logs.

`purchase` should submit the payment and return. The helper then waits for the user to approve, decline, or let the approval expire before it calls `readMerchantOrder`. The wait lasts up to 16 minutes, since Agentcard expires approvals after 15, and always ends 2 minutes before the 30-minute Notte session does. One `runCheckout` call can take about half an hour.

A full sandbox purchase on Agentcard's demo store has passed: the card request paused, the user approved with a passkey, and the merchant confirmed the order. Validate your own merchant checkout in Agentcard sandbox before production. Approval alone does not confirm an order.

The helper returns a status, optional confirmed order ID, and browser session ID. It attempts to close its page, browser connection, and session. If cleanup fails after reconciliation, it preserves the checkout result and adds a sanitized `cleanup_errors` list. Use the session ID to inspect and stop the owned session if needed; do not repeat the purchase. Follow up with the merchant when the outcome is unknown or needs user action. See [Agentcard's completion guide](https://docs.agentcard.com/vault/completing-a-purchase).


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