Skip to main content
Let your agent pay with your users’ own cards while it shops in a Notte hosted browser. Your agent types a placeholder card at checkout, the Agentcard SDK pauses the payment until the user approves it with their passkey, and the user’s device then pays with their real card. The SDK attaches to the session through Playwright over its cdpUrl(), the same way it attaches to any CDP browser. Before you start, you need a user who has added a card to the Vault, and the user_id you received when they added it. See Adding a card. Notte’s example runs on Node.js 24 or later.

Install

notte-sdk reads your Notte API key from NOTTE_API_KEY. Create one in the Notte console. The sample reads your Agentcard client id and secret from AGENTCARD_CLIENT_ID and AGENTCARD_CLIENT_SECRET. Create them in the dashboard, as step 1 of the Vault Quickstart shows.

Shop with your agent

Open a Notte session, connect Playwright to its cdpUrl(), and attach the SDK to the page before your agent reaches the payment form. The session lives as long as the use() callback, so the shopping, the approval and the order check all happen inside it.
shop, sendToUser and readMerchantOrder are yours. syncRegistry() loads the list of payment processors the SDK can pause, and you call it once after you create the client. The init script keeps the store from starting a service worker, and the SDK cannot pause a card request a service worker sends. Add it before the session’s first navigation. Block service workers explains what changes for the store. Have your agent type any of Stripe’s published test card numbers as the placeholder. The SDK pauses the payment and calls onApprovalUrl with a link to the user’s approval screen. Send the link from your own app, such as a push notification or an in-app message, and keep it out of your logs: the link opens the approval screen for this payment, and only the user should see it.

Wait for the approval

The card request stays paused until the user approves or declines on their device, which is why the loop above waits instead of reconciling straight away. The state is awaiting_approval while the user decides, and reconcile() throws if you call it then:
Your loop can still meet that error just after the user declines or the approval expires. The state has left awaiting_approval by then, and reconcile() throws the same error until the SDK has ended the paused request on the store’s page. Catch the error and call reconcile() again on the next pass. An uncaught error ends the use() callback, and Notte stops the session. Your agent returns right after it clicks Pay, and the store’s page can send the card request a moment later. Until the page sends that request, the state is idle, and the loop makes no reconcile() call in that state either. A reconcile() that early does not throw. reconcile() asks your readMerchantOrder, which finds no order yet. When readMerchantOrder answers { status: 'unknown' }, reconcile() returns:
After that result the SDK refuses every card request for that checkout, and the user gets no approval link for a refused request. A checkout you prepared with prepare() reads ready_to_submit until the store’s page sends the card request, and the loop holds off there too. If the store rejects the form, the click on Pay sends no card request and the state stays idle. The loop then waits up to 16 minutes and throws:
To stop sooner, have shop throw when the store’s page shows a form error after the click. Three clocks shape that wait:
  • An unapproved payment expires after 15 minutes, so wait a little longer than that, and the expiry’s own outcome lands instead of a timeout of your own.
  • A Notte session on a standard plan runs up to 30 minutes, which is max_duration_minutes above. Leave a couple of minutes at the end for reading the merchant’s order and closing the session.
  • Nothing happens in the session while the user approves, so idle_timeout_minutes has to be longer than the approval wait. An idle timeout shorter than the wait ends the session under the user.

Confirm the order

An approval is not proof that the merchant took the order, which is what readMerchantOrder is for: it reads the store’s own confirmation page or order API and never clicks Pay again. From here the purchase runs like any Vault purchase, so confirm the order with the merchant before you tell the user it is done, as step 4 of Completing a purchase shows.

End the session

The session closes when the use() callback returns, which is why the reading above happens inside it. Keep session.getId() from inside the callback: if closing fails the session is still yours, and that id is what you look it up with and stop it with in Notte. A purchase that already went through is never repeated, so log a failed cleanup and keep the checkout’s own result.

Next

Notte’s own write-up of this integration is Agentcard on docs.notte.cc, and the code it describes is examples/agentcard in their repository. It bought from the demo store in Agentcard sandbox on 12 November 2026: the card request paused, the user approved with a passkey, the payment went through and the merchant confirmed the order.