HTTP/402 · x402 PROTOCOL · USDC · USDT

402 Payment Required.
eSIM data for the agent web.

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.

One request. One payment. One eSIM.
$ curl
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": "..." }
$0.55 minimum order · USDC/USDT on Polygon or TON · 5-10 sec settlement
WHAT IS x402

An HTTP status code that pays itself.

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.

USE CASES

Who buys eSIMs without a human?

AI / LLM agent

AI travel agents

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.

Autonomous infra

Autonomous trading bots

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.

IoT / unattended

On-demand kiosks / IoT

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.

Privacy / pseudonymous

No-account workflows

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.

QUICKSTART

Three idioms.

Python — pip install esimx402
python
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)
Node / TypeScript — npm install esimx402
javascript
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 GitHub
PRICING

Pay-per-call. No commitment.

PER ORDER
$0.55 – $50
Same pricing as the consumer site (eSIM Ahora). 1GB Turkey: $0.72. 5GB Japan/30d: $6.21. 10GB Europe-30: $14. Full catalog of 2,500+ plans.
CHAINS
USDC · USDT
Polygon (5-10 sec, $0.001 gas). TON (3-5 sec, $0.005 gas). No bridges, no wrapped tokens. We accept native stablecoins on the chain you specify.
No subscription. No per-API-key fee. No volume tiers (yet — high-volume customers can email us for a wholesale discount: see Contact).

$ curl -X POST /order

Read the docs and ship in 10 minutes. No account, no support ticket, no contract.