# x402 Payment Firewall API

## Access

- Discovery: `GET https://proxy-monetize.fluxapay.xyz/api/transaction-firewall/90cb2947`
- Scan: `POST https://proxy-monetize.fluxapay.xyz/api/transaction-firewall/90cb2947/api/x402-scan`
- Price: use the current discovery response as authoritative
- Payment: FluxA x402 v3 intent mandate
- Optional attribution header: `X-Agent-ID: <agent-id>`

## Safety boundary

Scan the unpaid HTTP 402 JSON body before calling a wallet payment command. Never include `X-Payment`, `xPaymentB64`, a signed mandate, wallet credentials, or any other authorization material. This endpoint inspects payment metadata; it does not authorize or execute a payment.

## Request

```json
{
  "paymentRequired": {
    "x402Version": 1,
    "accepts": [
      {
        "scheme": "exact",
        "network": "base",
        "maxAmountRequired": "500000",
        "payTo": "0x1111111111111111111111111111111111111111",
        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "maxTimeoutSeconds": 300,
        "resource": "https://example.com/api/resource",
        "mimeType": "application/json"
      }
    ]
  },
  "expected": {
    "network": "base",
    "maxAmountAtomic": "500000",
    "payTo": "0x1111111111111111111111111111111111111111",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "resource": "https://example.com/api/"
  }
}
```

All `expected` fields are optional, but supply every value already learned from trusted user intent or first-party API metadata. `resource` is treated as a required URL prefix when present. Atomic amounts are integer strings.

## Response

The response contains `verdict`, `riskScore`, `findings`, normalized payment options, and limitations. Findings may flag unsupported versions or schemes, invalid amounts, mismatched networks, recipients, assets or resources, conflicting destinations, non-standard Base assets, invalid URLs, long timeouts, and accidental payment-token inclusion.

- On `block`, do not create or use a payment token.
- On `review`, explain the exact mismatch and require a fresh user decision.
- On `pass`, continue only within the user's approved mandate and amount. Do not call the payment safe or verified.
