Preflight a payment (allow / hold / block)
preflight_paymentSpend preflight for AI agents. Send the x402 PaymentRequired body (v1 or v2) you received, or a cart, plus optional rules (per-payment max, hold threshold, daily cap, allowlists, new-domain days). Returns allow|hold|block with reasons, the cheapest acceptable payment option, and a receipt id. Read-only: never signs, settles, or holds funds. Use before every payment. It includes payee screening in its spending-rule decision. For standalone wallet, name, or domain screening without a payment, use check_payee instead. Each repeat call creates a new receipt and may consume another trial or paid call. Price $0.02 per call (free trial first).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart | No | Use instead of challenge for agent checkout / card payments | |
| rules | No | Spending rules; all optional. See get_service_info for defaults. | |
| challenge | No | The x402 PaymentRequired body (v1 or v2) your agent received with HTTP 402 | |
| resource_url | No | URL that returned the 402, if not inside the challenge | |
| spent_today_usd | No | What this agent already spent today, for the daily cap |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payee | No | Payee screening details | |
| reasons | Yes | Every rule that fired, prefixed with its decision | |
| receipt | Yes | Log this for audit | |
| decision | Yes | Pay on allow, ask a human on hold, never pay on block | |
| chosen_option | No | The cheapest acceptable payment option | |
| options_evaluated | Yes |