{"uid":"cap_S_5bM0hbx9ZBzmldU2PiN","slug":"gw8-spend-policy-check-api-d3a6b1c2","name":"GW8 Spend Policy Check API","description":"[Spend policy: agent payment risk check] Before an AI agent pays an invoice or merchant: POST {payment, policy} -> allow / deny / needs_approval plus the rules that fired (per-tx limit, rolling cap, merchant categories, allow/deny lists, hours + timezone, assets/chains, approval threshold) and an Ed25519-signed receipt bound to your request hash. Deterministic, stateless, no custody, moves no money. Bad bodies rejected before payment. $0.02 USDC.","url":"https://micro-saas-agent.onrender.com/api/spend/check?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"policy":{"type":"object","example":{"currency":"USDC","allowList":["acme-supplies.com"],"perTxLimit":"1000","rollingCap":{"limit":"5000","spentSoFar":"1200","windowHours":24},"allowedHours":{"end":"18:00","days":["mon","tue","wed","thu","fri"],"start":"08:00","timezone":"America/Denver"},"allowedAssets":["USDC"],"allowedChains":["base"],"blockedCategories":["gambling","crypto-exchange"],"requireApprovalAbove":"750"}},"payment":{"type":"object","example":{"memo":"INV-10442","chain":"base","amount":"420.00","agentId":"ap-agent-7","currency":"USDC","timestamp":"2026-10-21T15:30:00Z","recipientId":"acct_acme_supplies","recipientDomain":"acme-supplies.com","merchantCategory":"office-supplies"}}}},"responseSchema":{"type":"json","example":{"checks":[{"rule":"per_tx_limit","detail":"420 <= per-tx limit 1000","result":"pass"}],"engine":"gw8-spend-policy/1","reasons":[],"decision":"allow","remaining":{"perTx":"1000","rollingCapAfter":"3380","rollingCapBefore":"3800"},"decisionReceipt":{"alg":"Ed25519","query":{"decision":"allow","requestSha256":"7faa…"},"signed":true,"payload":"eyJ2Ijox…","endpoint":"POST /api/spend/check","signature":"base64…","accessType":"SPEND_POLICY_DECISION","verify_url":"https://micro-saas-agent.onrender.com/api/receipt/verify","response_sha256":"…"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_EA53YhWOYhK7mRdShWEBf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a proposed payment against a configured spend policy (per-tx limit, rolling cap, allowed hours, blocked categories) and returns a signed allow/deny decision receipt","exampleAgentPrompt":"Before paying $420 USDC to acme-supplies.com for office supplies, check my spend policy — my per-tx limit is $1000, my 24-hour rolling cap is $5000 with $1200 already spent, payments are only allowed Mon–Fri 8am–6pm Mountain Time, and gambling and crypto-exchange categories are blocked.","exampleUseCases":[{"title":"Pre-payment policy gate for autonomous agent","prompt":"My agent is about to pay $420 USDC to acme-supplies.com for office supplies. Check my spend policy before it goes through — per-tx limit is $1000, 24-hour rolling cap is $5000 with $1200 already spent, and block anything in gambling or crypto-exchange categories."},{"title":"Enforce business-hours payment restriction","prompt":"I need to validate a $750 USDC payment to a SaaS vendor on a Saturday — my policy only allows payments Monday through Friday between 8am and 6pm Mountain Time. Tell me if this should be allowed or denied and give me a signed receipt."},{"title":"Check agent payment against rolling daily cap","prompt":"My agent fleet has a daily rolling cap of $5000 over 24 hours and has already spent $4800. Before sending another $420 USDC payment, check whether there's enough cap remaining and return the decision with a verifiable signed receipt."}],"resultDescription":"Returns a JSON object with: a 'decision' field ('allow' or 'deny'), an array of 'checks' showing each policy rule evaluated with pass/fail and detail, a 'reasons' array for any denials, 'remaining' budget figures (perTx and rollingCap before/after), the policy engine version, and a cryptographically signed 'decisionReceipt' (Ed25519) with a verify URL — enabling tamper-proof audit of spend decisions.","failureModes":["Missing or malformed 'policy' or 'payment' objects returns validation error","Payment timestamp outside allowed hours triggers deny decision","Amount exceeding per-tx limit triggers deny","Rolling cap exceeded triggers deny","Merchant category in blockedCategories triggers deny","Recipient not in allowList triggers deny if allowList is configured","Payment on non-allowed chain or with non-allowed asset triggers deny","No charge on API failure — payment only settled after data is returned"],"whenToPreferThis":"Use this endpoint when an AI agent needs a cryptographically auditable, policy-aware go/no-go decision before submitting a payment — especially when you need rolling cap tracking, time-of-day enforcement, category blocking, and a signed receipt for compliance. Prefer this over manual policy checks when you need a single atomic call that evaluates all spend rules simultaneously and returns a verifiable decision log. Best suited for agentic payment workflows using x402 on Base with USDC.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:40:57.160Z","isFirstParty":false,"canonicalSlug":"gw8-spend-policy-check-api-d3a6b1c2"}