Skip to main content
The best way to learn Sapiom is to try it in the sandbox. Here, we’ll go through a sandbox test purchase from start to finish on the Sapiom test store. To take it to production, simply switch the sandbox key with the production platform key.

Make a sandbox purchase

1

Set up

To test Sapiom, you’ll need a sandbox platform key, an MCP client, and a browser.
2

Create a user

Create a Sapiom user with your sandbox platform key:
3

Create a user key for that user

Create the key your agent uses for this user:
4

Add a card with a budget

Create a setup link with a $50 budget:
Open the link, choose test card 4242 4242 4242 4242, save it, then set the budget.
Sandbox Add a card page for a platform called Wayfare, with Scenario set to Success, test card 4242 4242 4242 4242, expiry 12/34, security code 123 and a Save card button

Adding a card in the sandbox

Leave Scenario on Success and Test card number on 4242 4242 4242 4242, enter an email and a name, click Save card, then confirm $50.00 on Set a budget.
5

Buy the test pen

Add the MCP server with the user key.
“List my saved Sapiom cards” shows the card and its budget.Ask the agent to buy the Sapiom pen from sapiom-test-store.myshopify.com. If the price is within the budget limit, no confirmation is needed from you.
Prompt
Save the transaction ID the agent reports:
The purchase is now payment_ready. Nothing is paid yet.
6

Pay at checkout

Your code pays in the merchant’s checkout with a placeholder card. Sapiom Browser Pay swaps in the real card on its way to the merchant.pay.mjs pays for the test pen:
  1. Reads the purchase and its placeholder card.
  2. Opens a browser: your hosted browser’s CDP_URL, or local Chromium.
  3. Enters the test store’s password and opens the checkout.
  4. Chooses Standard shipping, fills in the placeholder card and pays.
  5. Prints Completed once Sapiom has sent the card.
pay.mjs
Install its packages and run it:
The store charges $11.00 ($3.00 pen, $8.00 shipping) and shows the order.

Go live

Production works the same way, with production keys and real cards. Sandbox users, keys and cards don’t carry over.
  1. Turn the Sandbox switch off, and create a production platform key in API keys. See Set up your platform.
  2. When each of your users first uses Sapiom, create their Sapiom user and user key.
  3. Send them a setup link to add their card and set a budget.
  4. Your agent buys as in this guide. Production purchases pay merchants right away.
No approval from Sapiom is needed. Before launch, you can also add your branding, a webhook receiver and spending limits.