Buy travel mobile data with one HTTP request. No account, no API key, no human in the loop. Pay on-chain in USDC or USDT, get the eSIM QR back in seconds. Built for AI agents, autonomous bots, and short-lived workflows that need connectivity on demand.
curl -X POST https://api.esimahora.com/api/v1/x402/order \
-H "Content-Type: application/json" \
-d '{"country":"JP","plan":"5GB-30D"}'
# 402 Payment Required
# x-payto: 0x742d35cc6634c053... usdc polygon
# x-amount: 6.21
# x-expires: 2026-05-15T14:30:00Z
# After your wallet pays:
curl https://api.esimahora.com/api/v1/x402/order/abc123
# 200 OK
# { "iccid": "...", "qr_code_data": "LPA:1$...", "qr_image_url": "..." }HTTP 402 was reserved in 1997 for "Payment Required" — and stayed unused for 28 years. The x402 protocol finally fills it: when you call an API that costs money, the server replies with 402 + the payment details (recipient address, amount, chain, expiry). Your client pays on-chain, retries the request, and gets the resource.
Why this matters for eSIM data: a travel eSIM is a perfect API-payable resource — small ($0.55-$50), stateless, instantly delivered as a QR code. We expose the entire eSIM Ahora catalog (179 countries, 2,500+ plans) over x402 so any program — AI agent, autonomous service, IoT device — can buy connectivity without registering an account, holding a card, or even running interactive code.
A trip-planning agent books a flight + hotel and needs to pre-provision data for the device that will receive the boarding pass. The agent calls our API, pays from its budget wallet, attaches the QR to the trip artifact.
A surveillance / monitoring bot deployed on a VPS in a different region needs failover connectivity over a USB modem. It buys an emergency local eSIM the moment its primary link degrades.
A vending kiosk crosses borders inside a shipping container, hits a region with no network, and self-purchases the local data plan. No truck driver action, no central ops console.
A privacy-focused user wants travel data without leaving an account history with a connectivity company. x402 means the only record is an on-chain payment to a contract address.
from esimx402 import Client
from your_wallet import sign_and_pay # any wallet that signs ERC-20
with Client() as client:
# 1. Discover plans, pick the cheapest
plans = client.list_plans(country="JP")
plan = min(plans, key=lambda p: p.price_usd)
# 2. Request order — server returns 402 with on-chain invoice
invoice = client.create_order(plan_id=plan.id)
# 3. Pay the invoice from your wallet
sign_and_pay(
to=invoice.pay_to,
amount=invoice.amount,
chain=invoice.chain,
asset=invoice.asset,
)
# 4. Poll until eSIM is delivered (~5-15 s typical)
esim = client.wait_for_esim(invoice.order_id)
print(esim.qr_image_url)import { Client } from 'esimx402';
import { yourWallet } from './your-wallet'; // anything that signs ERC-20
const client = new Client();
const plans = await client.listPlans('JP');
const invoice = await client.createOrder(plans[0].id);
await yourWallet.send({
to: invoice.payTo,
amount: invoice.amount,
chain: invoice.chain,
asset: invoice.asset,
});
const esim = await client.waitForESim(invoice.orderId);
console.log(esim.qrImageUrl);Official open-source clients. MIT-licensed, zero-dependency wire format. Read, fork, or skip the SDK entirely — the protocol is just HTTP and works with the Coinbase x402 reference clients too.
View on GitHubRead the docs and ship in 10 minutes. No account, no support ticket, no contract.