How do I let my AI agent buy a gift card through an API?
Last reviewed: August 2026
Call GET /search-gift-cards to find the product’s laso_server_id, then call GET /order-gift-card with an amount and that id, paid in USDC over x402. The response already contains the redemption_code, pin_code, or redemption_url, so there is no polling step and the agent never needs a card number or a merchant account.
Why a gift card suits an agent
A gift card is a bounded purchase. The agent can only spend the face value, the code is delivered in the API response, and it works at merchants that would never accept a stablecoin. That makes it a good first purchase for an agent: the worst case is the amount you chose. The catalog covers 3,000+ brands across categories such as ecommerce, travel, gaming, and streaming.
The two calls
1. Find the product
Search is free and needs only a Bearer token. Call it once with no filters and read the facets object to learn every valid category, currency, and country value, then filter with q.
curl "https://laso.finance/search-gift-cards?q=amazon&country=US" \
-H "Authorization: Bearer $LASO_ID_TOKEN"
# {
# "gift_cards": [{
# "laso_server_id": "amazon",
# "name": "Amazon",
# "currency": "USD",
# "min": 5, "max": 2000, "increment": "0.01",
# "denominations": null
# }],
# "count": 1,
# "facets": { "categories": [...], "currencies": [...], "countries": [...] }
# }
Always copy laso_server_id from a search result. An id that is not in the catalog returns 404 unknown_laso_server_id before any payment is quoted. Honor min, max, and increment, and if denominations is set, only those exact amounts can be ordered.
2. Order it
Without a wallet of its own, the agent orders from a managed wallet with agentX402Pay in route mode. Laso signs and settles the payment, so no private key sits in the agent’s environment.
curl https://laso.finance/agentX402Pay \
-H "Authorization: Bearer $LASO_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{"data":{
"userId":"usr_...",
"route":"order-gift-card",
"params":{"amount":50,"laso_server_id":"amazon","country":"US"}
}}'
# { "result": { "status": 200, "body": { "gift_card": {
# "card_id": "gc_abc123",
# "amount": 50, "currency": "USD",
# "redemption_code": "XXXX-XXXX-XXXX",
# "pin_code": null, "redemption_url": null,
# "status": "completed"
# } }, "txHash": "..." } }
An agent that already holds its own wallet can call GET /order-gift-card?amount=50&laso_server_id=amazon&country=US directly with an x402 client library. The first request returns a 402 with the exact price, and the client repeats it with the signed payment attached.
Read the result
- Check the inner
statusof theagentX402Payresult, not the HTTP code. Anything outside 200 to 299 means nothing was delivered. - Different brands return different combinations of
redemption_code,pin_code, andredemption_url. Hand the user every field that is not null. txHashconfirms the payment settled. Do not repeat the order after a timeout until you have checked whether the first one completed.
The currency gotcha
amount is the face value in the product’s own currency, not USD. Laso converts it to USD and adds the product fee, typically 4.8% (U.S. Amazon is 0%), and that total is the USDC price. A 100 SAR card costs roughly $28 USDC, not $100. The $5 minimum and $9,000 maximum apply to the converted USD value. Read the product’s currency from the catalog and take the real price from the 402 quote.
Other ways to do it
Laso is not the only catalog an agent can buy from. Bitrefill offers gift cards to agents through an MCP integration and lists crypto, card, and balance payment methods, with OAuth, client credentials, or API keys for access (see Bitrefill for agents). If your agent already has a Bitrefill account, that may be the shorter path. Laso fits when the agent should pay in USDC with no account to create, with the amount capped by the wallet balance and the account spend limit.
If the merchant you need does not sell gift cards, order a prepaid card instead, which works at any checkout that accepts cards.
Full reference: ordering a gift card, paying from the managed wallet, and how x402 works.
Frequently asked questions
Can an AI agent buy a gift card without a human approving each purchase?
Yes. The agent pays from a funded wallet, and the account owner’s per-payment spend limit, which the agent cannot raise, caps any single order.
How does my agent get the gift card code?
It comes back in the order response as redemption_code, pin_code, and/or redemption_url, depending on the brand. There is nothing to poll.
How do I find the right gift card product id?
Call GET /search-gift-cards with q set to the brand name and copy the laso_server_id from the result. Add country to pick a regional variant.
Why did my gift card cost less than the amount I asked for?
The amount is in the product’s own currency. Laso converts it to USD before pricing, so a card in a weaker currency costs fewer USDC than its face value suggests.
What if my agent orders a gift card twice by mistake?
Each order is a separate paid purchase. Check txHash and the account balance before retrying after a timeout, and do not repeat an order that may have completed.
More guides
- How to give your AI agent a credit card — An AI agent cannot pass credit underwriting, but it can issue itself a virtual prepaid card over an API in about a minute. The working pattern, with real requests: x402 payment in, card number out.
- x402 vs AP2 vs ACP vs MPP vs UCP: which should your agent use? — All five agent payment protocols compared honestly: x402 and MPP for machine-to-machine HTTP payments, ACP for ChatGPT checkout, UCP for Google surfaces, AP2 for authorization. Which layer each one is, when to use each, and a worked x402 example.
- x402 vs Stripe Issuing for AI agents — Two real ways to put a card in an AI agent’s hands: Stripe Issuing behind a business account, or x402 card issuance the agent drives itself. An honest comparison of onboarding, funding, controls, and when each wins.
- Issue a virtual card with one x402 call — A complete, runnable walkthrough: pay one x402 request in USDC and receive a virtual prepaid card with number, expiry, and CVV. Real endpoints, real response shapes, error handling included.
- How can an AI agent pay for an API call with USDC? — An AI agent pays for an API call with USDC by answering the API’s HTTP 402 challenge with a signed payment. Two ways to do it: your own wallet with an x402 client, or a managed wallet with a price cap and no private key.
- How do I give an AI agent a bank account? — Two real ways to give an AI agent bank details: a business checking account it can operate (Meow) or a U.S. bank account that converts incoming dollars to USDC in the agent’s wallet (Laso). What each one is, who approves what, and when to pick which.
- How do I cap how much my AI agent can spend? — Cap an AI agent’s spending with limits it cannot raise: a funded balance, a per-payment spend limit set by the account owner, a per-call price cap, and prepaid cards loaded with exactly the amount to spend.
- How do I send money to someone’s debit card from code? — Send USD, EUR, or GBP to a debit card with one API call paid in USDC. No payment processor account: you get a redemption link, the cardholder enters their own card details, and the funds are pushed to the card.
- What are the best ways to pay someone on Venmo or PayPal from an AI agent? — Four ways an AI agent can pay a person on Venmo or PayPal: the PayPal Payouts API, a USDC-paid payout through Laso, a bank or card payout instead, or a human approving each payment. Tradeoffs for each.
- How do I let my AI agent buy something online? — Two working ways for an AI agent to buy something online: spend the account holder’s saved card with their approval on each order, or pay for a prepaid card in USDC and check out like any cardholder. How Laso and Crossmint each handle it, with runnable calls.
- How do I send dollars to a bank account from an AI agent? — Pay a U.S. bank account by ACH from an AI agent. Register the recipient once, then make one API call paid in USDC. Limits, fees, settlement time, and a runnable example.
- What are the best ways to give an AI agent its own wallet? — Four ways to give an AI agent a wallet it can spend from: a key you hold yourself, Coinbase Agentic Wallet, Crossmint agent wallets, or a Laso managed wallet. Custody, spend limits, and tradeoffs for each.
- How do I get notified when my AI agent spends money? — Get an alert every time your AI agent spends: register one signed webhook for card orders, payouts, withdrawals and deposits, or poll the balance and card transaction endpoints. Working code included.
- How do I convert USDC to fiat in my app without a multi-week integration? — Three ways to turn USDC into dollars, euros, or pounds from code: Laso pay-per-call payouts over x402, a Stripe stablecoin balance, or Circle Mint redemption. Onboarding, outputs, and tradeoffs for each.
- How do I let my AI agent use my own credit card safely? — Let an AI agent pay with your own card without ever handling the number: save the card once behind a passkey, let the agent build the cart over an API, and approve each order on your own device. Working calls included.
- How do I let my AI agent pay for a subscription that bills every month? — A subscription charges the same card again each month, so a single-use card fails at the first renewal. Four ways to give an AI agent a card that stays open, from Privacy, Ramp, Meow, and Laso, with the calls for a reloadable card funded in USDC.
- How do I move USDC between Solana and Base from an AI agent? — Move USDC between Solana and Base from an AI agent with one HTTP call: no bridge UI, no gas token on either chain, and no private key in the agent. Working curl examples, fees, and timing.
- How do I give my AI agent a card I can top up with USDC? — Three ways to give an AI agent a card that spends USDC and can be refilled: MoonPay’s MoonAgents Card, the Interlace Agent Card, and a Laso reloadable card. How each is funded, what limits apply, who can use it, and the calls to top one up.
- How can my AI agent buy from an online store outside the US? — Let an AI agent pay a non-U.S. online store: order an international prepaid card in USDC over x402, wait for it to be fulfilled, then check out with the returned card number and billing address. Working code included.
- What are the best ways for an AI agent to send money to someone in another country? — Five ways an AI agent can pay a person abroad: the Wise API, PayPal Payouts, a USDC-paid debit card payout in EUR or GBP, a gift card in the recipient’s country, or USDC sent straight to their wallet. Setup, limits, and tradeoffs for each.
- How do I check if a store will accept my AI agent’s card before buying? — Before an AI agent pays for a prepaid card, it can look the store up with GET /search-merchants and get accepted, not_accepted, or unknown from real transaction history. A working pre-purchase check with fallbacks for stores that decline.
- All agent guides, or how Laso compares to the alternatives
Try it: connect a wallet at laso.finance and you'll have a card, gift card, or payout in minutes.
Building an agent? Point it at laso.finance/SKILL.md — it can set itself up.