{"service":"play-asia.com","protocol":"L402","api_version":"v1","status":"beta","base_url":"https:\/\/www.play-asia.com\/l402\/v1","skill_url":"https:\/\/www.play-asia.com\/l402\/v1\/skill","mcp_url":"https:\/\/www.play-asia.com\/l402\/mcp","notice":"The L402 agentic platform is currently in beta. Endpoints and behaviour may change.","description":"Agentic shopping API for digital codes, game vouchers, and more. Three ways to buy: Wallet (instant with token), Bitcoin on-chain (anonymous), Lightning (anonymous, instant). For full documentation fetch the skill_url.","endpoints":{"GET \/l402\/v1\/catalog":"List digital products (free, cached). Params: q=search, limit, offset, currency","GET \/l402\/v1\/price?pax={PAX}":"Get product price in USD + sats. PAX is the product code.","GET \/l402\/v1\/pricing":"View L402 resource pricing (what endpoints cost in sats)","GET \/l402\/v1\/info":"This info page (free)","GET \/l402\/v1\/product?pax={PAX}":"Start Lightning purchase. Returns invoice. Send 402 back with macaroon:preimage to get code.","POST \/l402\/v1\/buy":"Buy digital product. Params: pax, method (lightning\/bitcoin). With X-PA-Token: use wallet. Without: anonymous BTC\/LN.","GET \/l402\/v1\/order?oid={id}&order_sid={session}":"Get order status + digital code. Use token or order_sid from anonymous purchase to track.","GET \/l402\/v1\/btc\/blockheight":"Current block height, hash, difficulty, chain name","GET \/l402\/v1\/btc\/mempool":"Mempool size, bytes, total fees, max size","GET \/l402\/v1\/btc\/fees":"Recommended fees: fastest, half_hour, hour, economy (sat\/vbyte)","GET \/l402\/v1\/btc\/rates":"BTC\/fiat rates for 30+ currencies","GET \/l402\/v1\/btc\/block?height={n}":"Get block by height or hash. Returns hash, time, size, tx count.","GET \/l402\/v1\/btc\/utxo?txid={hex}&vout={n}":"Check if UTXO is unspent. Returns value, confirmations.","GET \/l402\/v1\/btc\/decode-tx?hex={rawtx}":"Decode raw transaction hex. Returns inputs, outputs, fees.","POST \/l402\/v1\/btc\/broadcast-tx":"Broadcast signed transaction. Body: { hex: \"...\" }. Returns txid.","GET \/l402\/v1\/btc\/validate-address?addr={addr}":"Validate Bitcoin address. Returns is_valid, script_type.","GET \/l402\/v1\/ln\/decode-invoice?invoice={bolt11}":"Decode Lightning invoice. Returns amount, destination, payment_hash.","GET \/l402\/v1\/ln\/node-info":"Our Lightning node info: pubkey, alias, channels, capacity.","GET \/l402\/v1\/ln\/node-lookup?pubkey={hex}":"Lookup any Lightning node in the graph. Returns alias, channels.","GET \/l402\/v1\/ln\/query-route?dest={pubkey}&amt={sats}":"Find route to destination. Returns hops, fees.","GET \/l402\/v1\/account\/balance":"Get wallet balance. Returns array of {currency, amount} for USD, sats.","GET \/l402\/v1\/account\/transactions":"Wallet history. Params: limit, offset. Returns {id, amount, text, date, currency}.","POST \/l402\/v1\/account\/topup":"Top up wallet. Body: { method: \"bitcoin\"|\"lightning\", amount }. Returns invoice\/address.","GET \/l402\/v1\/account\/orders":"List orders. Params: limit, offset. Returns {order_id, status, date, total, currency}.","GET \/l402\/v1\/account\/tokens":"List your platform tokens (safe view - never shows full token).","POST \/l402\/v1\/account\/tokens\/create":"Create new platform token. Body: { label, scope: \"info\"|\"purchase\", daily_limit_usd, weekly_limit_usd }.","POST \/l402\/v1\/account\/tokens\/revoke":"Revoke token. Body: { token_id }.","POST \/l402\/v1\/account\/tokens\/update":"Update token. Body: { token_id, label, scope, daily_limit_usd, weekly_limit_usd }.","POST \/l402\/v1\/cs\/submit":"Submit ticket. Body: { subject, message, reference }. Returns ticket_id.","GET \/l402\/v1\/cs\/enquiries":"List tickets. Params: status=open|closed|all.","GET \/l402\/v1\/cs\/enquiry?id={id}":"Get ticket thread.","POST \/l402\/v1\/cs\/reply":"Reply to ticket. Body: { id, message }.","POST \/l402\/v1\/cs\/close":"Close ticket. Body: { ticket_id }."},"auth":{"l402":"For L402-gated endpoints (BTC\/LN data). Flow: request \u2192 402 with invoice \u2192 pay \u2192 retry with \"Authorization: L402 <macaroon>:<preimage>\"","platform":"For account endpoints. Header: \"X-PA-Token: pa_YOUR_TOKEN_HERE\". Get token at https:\/\/www.play-asia.com\/account\/access-tokens","scopes":{"info":"Read-only (balance, orders, tickets)","purchase":"Can buy with wallet balance"},"anonymous":"Bitcoin on-chain purchases need no auth. Save order_id + sid from response to poll for code later."},"payments":{"methods":["Lightning Network (instant)","Bitcoin on-chain (~20 min)","Wallet balance (with platform token)"],"currencies":["USD","SATS","BTC"]},"errors":{"402":"Payment Required - pay the invoice, then retry with auth header","429":"Rate Limited - wait and retry","401":"Unauthorized - invalid or missing X-PA-Token","403":"Forbidden - token lacks required scope (e.g. purchase)","404":"Not Found - product\/order\/ticket does not exist"},"examples":{"search":"GET \/l402\/v1\/catalog?q=steam&limit=5","lightning_buy":"POST \/l402\/v1\/buy { pax: \"PAX0004012102\" } \u2192 402 with invoice \u2192 pay \u2192 retry with L402 header","bitcoin_buy":"POST \/l402\/v1\/buy { pax: \"PAX0004012102\", method: \"bitcoin\" } \u2192 save order_sid \u2192 poll \/order?oid=X&order_sid=Y","wallet_buy":"POST \/l402\/v1\/buy with X-PA-Token header (requires purchase scope)","check_order":"GET \/l402\/v1\/order?oid=12345 or GET \/l402\/v1\/order?oid=12345&order_sid=ABC"}}