{"name":"Cryout API","version":"0.1.0","baseUrl":"https://cryout.turonex.it","docs":"https://cryout.turonex.it/docs/api","note":"Merchant checkout: shopId + X-Cryout-Shop-Key. Funds: ephemeral → host main (ledger credit) → merchant payout (ledger debit). Admin/portal private.","enums":{"assets":["BTC","ETH","USDT","USDC","SOL"],"fiat":["USD","EUR","GBP"],"networks":["bitcoin","ethereum","solana","tron","polygon","arbitrum","bsc"],"modes":["auto","manual"],"providers":["guardarian","changehero","stealthex","moonpay","transak","banxa"],"orderStatus":["created","awaiting_payment","processing","completed","failed"],"outcomeStatus":["pending","success","failed"]},"endpoints":[{"method":"GET","path":"/api","description":"This index"},{"method":"POST","path":"/api/admin/login","description":"Admin login → httpOnly cookie","body":{"key":"deton-admin"}},{"method":"POST","path":"/api/admin/logout","description":"Clear admin cookie"},{"method":"GET","path":"/api/admin/session","description":"Admin session + stats (auth required)"},{"method":"GET","path":"/api/providers","description":"List on-ramp providers (low-KYC + full-KYC)"},{"method":"POST","path":"/api/quote","description":"Get one routed quote, or all provider quotes when body.all=true","body":{"fiatAmount":100,"fiat":"EUR","asset":"BTC","mode":"auto","preferLowKyc":true,"providerId":null,"all":false}},{"method":"GET","path":"/api/wallets","description":"List receive wallets (payout destinations)"},{"method":"POST","path":"/api/wallets","description":"Create a receive wallet","body":{"label":"Treasury BTC","asset":"BTC","network":"bitcoin","address":"bc1…","isDefault":true}},{"method":"GET","path":"/api/wallets/:id","description":"Get one receive wallet"},{"method":"PATCH","path":"/api/wallets/:id","description":"Update label/address/default/network/asset"},{"method":"DELETE","path":"/api/wallets/:id","description":"Delete a receive wallet"},{"method":"GET","path":"/api/settings","description":"Get operator settings (email)"},{"method":"PUT","path":"/api/settings","description":"Set required operator email","body":{"email":"ops@example.com"}},{"method":"POST","path":"/api/shop/checkout","description":"Merchant payment. Requires shopId + X-Cryout-Shop-Key. Mode A: pass asset. Mode B: omit asset (buyer picks on /shop/:id).","body":{"shopId":"your_shop_id","fiatAmount":49.99,"fiat":"EUR","asset":"USDT","email":"buyer@shop.com","externalOrderId":"ORD-1001","returnUrl":"https://yoursite.com/thanks"}},{"method":"GET","path":"/api/shop/checkout","description":"List shop checkouts + assets you can accept"},{"method":"GET","path":"/api/shop/checkout/:id","description":"Shop session + qrDataUrl + tokenMint when locked"},{"method":"POST","path":"/api/shop/checkout/:id/asset","description":"Mode B: lock crypto chosen by buyer","body":{"asset":"USDT"}},{"method":"POST","path":"/api/shop/checkout/:id/verify","description":"Poll on-chain; seals completed when paid"},{"method":"GET","path":"/api/orders","description":"List card on-ramp orders (newest first)"},{"method":"POST","path":"/api/orders","description":"Card on-ramp (ops). Requires email + walletId. Returns checkoutUrl.","body":{"fiatAmount":100,"fiat":"EUR","asset":"BTC","mode":"auto","preferLowKyc":true,"providerId":null,"walletId":"e84cee2e","email":"ops@example.com"}},{"method":"GET","path":"/api/orders/:id","description":"Get order + outcome (confirmationId when sealed success/failed)"},{"method":"POST","path":"/api/orders/:id/verify","description":"Poll ephemeral address on-chain; seals when expected amount arrives"},{"method":"POST","path":"/api/orders/:id/simulate-payment","description":"Demo: credit ephemeral wallet then verify"},{"method":"GET","path":"/api/ephemeral/funds","description":"Admin: totals per coin + balance breakdown by ephemeral wallet"},{"method":"GET","path":"/api/ephemeral/:id/sweep","description":"Admin: fee + margin quote for sweep to main wallet"},{"method":"POST","path":"/api/ephemeral/:id/sweep","description":"Admin: sweep ephemeral → treasury","body":{"demo":false}},{"method":"POST","path":"/api/ephemeral/:id/secret","description":"Admin: reveal private key + recovery mnemonic on request","body":{"confirm":true}},{"method":"PATCH","path":"/api/orders/:id","description":"Admin-only force status (completed/failed). Clients use verify + your watcher","body":{"status":"completed"}},{"method":"POST","path":"/api/webhooks/onramp","description":"Indexer: credit on ephemeral watchAddress","body":{"address":"0x…","amount":0.0016,"txHash":"0x…","confirmations":3}},{"method":"GET","path":"/api/confirmations/:confirmationId","description":"Lookup sealed outcome (on-ramp, deposit, or swap) by confirmation id"},{"method":"GET","path":"/api/deposits","description":"List crypto wallet-pay deposits"},{"method":"POST","path":"/api/deposits","description":"Create crypto payment. Returns payUrl + depositAddress (QR on GET :id)","body":{"asset":"BTC","amount":0.01,"walletId":"e84cee2e","email":"ops@example.com"}},{"method":"GET","path":"/api/deposits/:id","description":"Deposit + paymentUri + qrDataUrl"},{"method":"POST","path":"/api/deposits/:id/verify","description":"Backend chain check. Seals completed only if watcher evidence matches amount + confs"},{"method":"POST","path":"/api/deposits/:id/simulate-payment","description":"Demo: fake chain sighting then verify"},{"method":"POST","path":"/api/webhooks/deposit","description":"Chain watcher webhook (X-Cryout-Webhook). Ingests sighting + verify","body":{"depositId":"…","amount":0.01,"txHash":"0x…","confirmations":3}},{"method":"PATCH","path":"/api/deposits/:id","description":"Admin-only force status. Clients use verify + webhooks","body":{"status":"completed"}},{"method":"GET","path":"/api/swaps/providers","description":"Crypto↔crypto swap providers (optional product)"},{"method":"POST","path":"/api/swaps/quote","description":"Swap quote (auto / manual / all)","body":{"fromAsset":"BTC","toAsset":"ETH","fromAmount":0.01,"mode":"auto","all":false}},{"method":"GET","path":"/api/swaps","description":"List swaps"},{"method":"POST","path":"/api/swaps","description":"Create swap. Requires email + walletId for toAsset. Returns depositUrl.","body":{"fromAsset":"BTC","toAsset":"ETH","fromAmount":0.01,"mode":"auto","walletId":"e84cee2e","email":"ops@example.com"}},{"method":"GET","path":"/api/swaps/:id","description":"Get swap + outcome"},{"method":"PATCH","path":"/api/swaps/:id","description":"Update swap status → confirmationId on completed","body":{"status":"completed"}}],"flow":["PUT /api/settings { email }","POST /api/wallets { label, asset, network, address }","Card/wallet: create → unique ephemeral address → poll /verify → POST /api/ephemeral/:id/sweep","GET /api/confirmations/:confirmationId"]}