Skip to main content

How to make an online purchase

Once your agent is set up and authenticated, it can buy things online using a prepaid card from Laso Finance. Here are example prompts:
I need you to buy [item] from [store]. First, navigate to the store,
add the item to cart, and go to checkout to find the exact total
(including tax and shipping). Then order a prepaid card from Laso
Finance for exactly that amount using the x402 API at
https://laso.finance/get-card. Once you have the card details, use them
to complete the purchase. Ship to: [address].
Send $25 to the Venmo account with phone number 5551234567 using the Laso
Finance API. Use the x402 endpoint at https://laso.finance/send-payment
with amount=25, platform=venmo, and recipient_id=5551234567.
Send $100 to user@example.com on PayPal using the Laso Finance API. Use
the x402 endpoint at https://laso.finance/send-payment with amount=100,
platform=paypal, and recipient_id=user@example.com.

What happens under the hood

When your agent calls a Laso Finance endpoint, the x402 protocol handles payment automatically:
1

Agent navigates to the store

Your agent browses the merchant’s website, adds items to cart, and proceeds to checkout to determine the exact purchase total (including tax and shipping).
2

Agent checks merchant compatibility (optional)

Before ordering a card, your agent can call GET /search-merchants?q=nike to check if the card is known to work at that merchant. If the merchant comes back as accepted, you’re good to go. If not_accepted, the card will fail there. If the merchant isn’t listed or is unknown, it just means no one has tried it yet — the card likely will still work.
3

Agent orders a card for the exact amount

Your agent calls https://laso.finance/get-card?amount=X where X is the checkout total.
4

Server responds with payment details

The server returns a 402 Payment Required response with the price, recipient wallet address, and network (Base USDC).
5

Agent pays via Locus wallet

The x402 client automatically constructs a payment using your agent’s Locus wallet and replays the request.
6

Card is issued

The server verifies payment and returns a card_id. Card details (number, CVV, expiry) become available in ~7-10 seconds.
7

Agent retrieves card details

Your agent polls https://laso.finance/get-card-data?card_id=X with the Bearer token until status is "ready".
8

Agent completes the purchase

Your agent enters the card number, CVV, and expiry on the checkout page to complete the order.

Example: buying an item

Here’s what a full purchase flow looks like when you tell your agent to buy something:
Buy me a pair of Nike Air Max 90s in size 10 from Nike.com. Use Laso Finance
to pay. Ship to: 123 Main St, Austin TX 78701.
Your agent will:
  1. Navigate to Nike.com and find the Nike Air Max 90s in size 10
  2. Add the item to cart and proceed to checkout
  3. Determine the exact total including tax and shipping (e.g. $148.23)
  4. Call GET https://laso.finance/get-card?amount=148.23 via x402 (pays $148.23 USDC from Locus wallet)
  5. Receive a card_id and id_token in the response
  6. Poll GET https://laso.finance/get-card-data?card_id=X with the Bearer token until the card details are ready
  7. Enter the card number, CVV, and expiry on the checkout page
  8. Enter the shipping address and complete the order
Cards are US only. They can only be used at US-based merchants for USD purchases. Physical goods must ship to a US address.
Cards are non-reloadable, so ideally your agent should order a card for the exact amount of the checkout total. That way there are no extra funds left over on the card.