{"ok":true,"service":"Action402","generatedAt":"2026-05-23T02:45:55.280Z","purpose":"Copy-paste integration snippets for agents buying one Action402 execution and verifying the returned proof.","payment":{"required":true,"route":"https://action402.vercel.app/api/execute/webhook","price":"$0.003","network":"eip155:8453","networkName":"Base mainnet","scheme":"exact"},"groups":[{"id":"discovery","title":"Discovery","description":"Find and inspect Action402 before hard-coding the paid route.","snippets":[{"id":"cdp-bazaar-search","title":"CDP Bazaar search","language":"bash","code":"npx awal@latest x402 bazaar search \"Action402\" -k 5 --json\nnpx awal@latest x402 details https://action402.vercel.app/api/execute/webhook --json"},{"id":"metadata-fetch","title":"Direct metadata fetch","language":"bash","code":"curl https://action402.vercel.app/api/quickstart\ncurl https://action402.vercel.app/api/pricing\ncurl https://action402.vercel.app/api/mcp\ncurl https://action402.vercel.app/api/actions\ncurl https://action402.vercel.app/api/bazaar"}]},{"id":"paid-call","title":"Paid execution","description":"Preflight the payload, then buy one bounded public HTTPS action through x402.","snippets":[{"id":"preflight-policy-check","title":"Free preflight policy check","language":"bash","code":"curl https://action402.vercel.app/api/policy/check \\\n  -H \"content-type: application/json\" \\\n  -d '{\"url\":\"https://httpbin.org/anything\",\"method\":\"POST\",\"body\":{\"event\":\"agent.preflight\"},\"idempotencyKey\":\"preflight-001\",\"timeoutMs\":10000}'"},{"id":"agentcash-powershell","title":"AgentCash from Windows PowerShell","language":"powershell","code":"npx --% agentcash fetch https://action402.vercel.app/api/execute/webhook -m POST -H \"content-type: application/json\" -b \"{\\\"url\\\":\\\"https://httpbin.org/anything\\\",\\\"method\\\":\\\"POST\\\",\\\"body\\\":{\\\"event\\\":\\\"agent.snippet\\\"},\\\"idempotencyKey\\\":\\\"agent-snippet-001\\\",\\\"timeoutMs\\\":10000}\" --payment-protocol x402 --payment-network base --max-amount 0.01 -y --format json"},{"id":"unpaid-402-check","title":"Unpaid 402 check","language":"bash","code":"curl -i https://action402.vercel.app/api/execute/webhook \\\n  -H \"content-type: application/json\" \\\n  -d '{\"url\":\"https://httpbin.org/anything\",\"method\":\"POST\",\"body\":{\"event\":\"agent.unpaid-check\"},\"idempotencyKey\":\"unpaid-check-001\"}'"}]},{"id":"decision-first","title":"Decision graph","description":"Ask Action402 for a free deterministic recommendation before paying, then use guided execution to link the decision, job, receipt, and outcome.","snippets":[{"id":"free-decision","title":"Create a free decision record","language":"bash","code":"curl https://action402.vercel.app/api/decide/webhook \\\n  -H \"content-type: application/json\" \\\n  -d '{\"action\":{\"url\":\"https://httpbin.org/anything\",\"method\":\"POST\",\"body\":{\"event\":\"agent.decision-first\"},\"idempotencyKey\":\"agent-decision-first-001\",\"timeoutMs\":10000},\"buyerPolicy\":{\"maxPriceUsd\":\"0.01\",\"requireReceipt\":true,\"requirePolicyPass\":true,\"requireIdempotencyKey\":true,\"minTrustScore\":55}}'"},{"id":"guided-agentcash-powershell","title":"Guided paid execution from Windows PowerShell","language":"powershell","code":"npx --% agentcash fetch https://action402.vercel.app/api/execute/guided-webhook -m POST -H \"content-type: application/json\" -b \"{\\\"decisionId\\\":\\\"dec_...\\\",\\\"action\\\":{\\\"url\\\":\\\"https://httpbin.org/anything\\\",\\\"method\\\":\\\"POST\\\",\\\"body\\\":{\\\"event\\\":\\\"agent.decision-first\\\"},\\\"idempotencyKey\\\":\\\"agent-decision-first-001\\\",\\\"timeoutMs\\\":10000}}\" --payment-protocol x402 --payment-network base --max-amount 0.01 -y --format json"},{"id":"recent-decisions","title":"Inspect recent public decisions","language":"bash","code":"curl https://action402.vercel.app/api/decisions/recent\ncurl https://action402.vercel.app/decisions"}]},{"id":"verification","title":"Verification","description":"Treat the paid action as complete only after proof verification passes.","snippets":[{"id":"verify-job-javascript","title":"Verify a returned job in JavaScript","language":"javascript","code":"const result = await paidResponse.json();\nconst verifyResponse = await fetch(`https://action402.vercel.app/api/verify/jobs/${result.job.id}`);\nconst report = await verifyResponse.json();\nif (!report.ok || !report.signatureVerified || report.checks.some((check) => !check.ok)) {\n  throw new Error(\"Action402 proof verification failed\");\n}\nconsole.log(report);"},{"id":"verify-job-curl","title":"Verify job with curl","language":"bash","code":"curl https://action402.vercel.app/api/verify/jobs/job_...\ncurl https://action402.vercel.app/proof/job_..."},{"id":"verify-receipt-curl","title":"Verify receipt with curl","language":"bash","code":"curl https://action402.vercel.app/api/verify/receipts/rcpt_...\ncurl https://action402.vercel.app/api/receipts/rcpt_..."}]},{"id":"advanced-surfaces","title":"Advanced agent surfaces","description":"Use these free endpoints for handoff, schedule design, and secret-handling decisions before building around paid execution.","snippets":[{"id":"browser-handoff","title":"Create browser handoff package","language":"bash","code":"curl https://action402.vercel.app/api/handoff/browser \\\n  -H \"content-type: application/json\" \\\n  -d '{\"targetUrl\":\"https://example.com\",\"actions\":[{\"type\":\"navigate\",\"description\":\"Open target page\"},{\"type\":\"verify\",\"text\":\"Check visible success state\"}],\"idempotencyKey\":\"handoff-001\"}'"},{"id":"schedule-preview","title":"Preview future schedule","language":"bash","code":"curl https://action402.vercel.app/api/schedules/preview \\\n  -H \"content-type: application/json\" \\\n  -d '{\"webhook\":{\"url\":\"https://httpbin.org/anything\",\"method\":\"POST\",\"body\":{\"event\":\"agent.scheduled-preview\"},\"idempotencyKey\":\"schedule-preview-001\"},\"schedule\":{\"type\":\"daily\",\"timeOfDay\":\"09:30\",\"timezone\":\"UTC\"}}'"},{"id":"secret-policy","title":"Read secret policy","language":"bash","code":"curl https://action402.vercel.app/api/secrets/policy"}]},{"id":"buyer-policy","title":"Buyer policy","description":"Guardrails agents should check before spending.","snippets":[{"id":"payment-guardrail","title":"Expected payment requirement","language":"text","code":"Expected service: Action402\nExpected route: POST /api/execute/webhook\nExpected price: $0.003\nExpected network: Base mainnet\nReject payment if price, network, or resource URL does not match buyer policy."},{"id":"completion-rule","title":"Completion rule","language":"text","code":"Mark the action complete only when the paid response is success/accepted and the verification report returns ok=true with signatureVerified=true."}]}],"links":{"quickstart":"https://action402.vercel.app/api/quickstart","pricing":"https://action402.vercel.app/api/pricing","mcpManifest":"https://action402.vercel.app/api/mcp","policyCheck":"https://action402.vercel.app/api/policy/check","decisionGraph":"https://action402.vercel.app/api/decide/webhook","guidedWebhook":"https://action402.vercel.app/api/execute/guided-webhook","recentDecisions":"https://action402.vercel.app/api/decisions/recent","decisionsPage":"https://action402.vercel.app/decisions","handoff":"https://action402.vercel.app/api/handoff/capabilities","schedulePreview":"https://action402.vercel.app/api/schedules/preview","secretPolicy":"https://action402.vercel.app/api/secrets/policy","actions":"https://action402.vercel.app/api/actions","capabilities":"https://action402.vercel.app/api/capabilities","bazaar":"https://action402.vercel.app/api/bazaar","openapi":"https://action402.vercel.app/openapi.json","snippetsPage":"https://action402.vercel.app/snippets","proofBadge":"https://action402.vercel.app/proof/{jobOrReceiptId}"}}