# x402 Invoice Decode & Validator

> x402 Invoice Decode & Validator is a paid API for AI agents from x402-research-iota.vercel.app, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Decodes and validates a base64-encoded x402 PAYMENT-REQUIRED header, returning a structured analysis of payment requirements including asset, network, amount, scheme, and overall verdict.

## Facts

- Endpoint: GET https://x402-research-iota.vercel.app/api/x402/invoice-decode?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-invoice-decode-validator-e0bcb7b9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Pr0RGgcKvhELeYFxA4QUh

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-invoice-decode-validator-e0bcb7b9
```

Example prompt: Can you decode this x402 PAYMENT-REQUIRED header for me and tell me whether it's valid, what network it's on, how much USDC it's asking for, and what address to pay? Here's the base64 value: eyJ4NDAyVmVyc2lvbiI6Mi4uLn0=

## When to prefer this

Use this endpoint when you need to programmatically inspect or validate an x402 PAYMENT-REQUIRED header before deciding whether to proceed with payment — especially useful for debugging integration issues, auditing payment requirements, or building x402-aware agent pipelines that need to parse payment terms without making the actual payment.

## Known failure modes

- Missing or malformed 'header' query parameter returns an error or empty result
- Invalid base64 input causes a decode failure
- Well-formed base64 but non-x402 payload produces a fail verdict
- Network issues to the decoder service return a 5xx error
- Unsupported x402 version may return a warn or fail verdict

## How this service works

Use before paying any x402 invoice: decodes a base64 PAYMENT-REQUIRED header (query ?header= or JSON body {header}) and checks scheme exact, Base mainnet, Base USDC asset, payTo (EOA/contract/EIP-7702), human amount, timeout; returns verdict ok/warn/fail with reasons. Errors: 400 invalid header. Read-only; never signs or pays.

## Output

Returns a JSON object with the decoded x402 payment details: a top-level verdict (ok/warn/fail), an array of accepted payment options (each with asset contract address, payTo EOA address, amount, amount in USDC, network chain ID, scheme, max timeout, and per-check results), a reasons array for any warnings or failures, the resource URL the payment unlocks, and the x402 protocol version.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "header"
     ],
     "properties": {
      "header": {
       "type": "string",
       "description": "base64 PAYMENT-REQUIRED header value"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "signed": {
       "type": "boolean"
      },
      "accepts": {
       "type": "array",
       "items": {
        "type": "object"
       }
      },
      "reasons": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "verdict": {
       "enum": [
        "ok",
        "warn",
        "fail"
       ],
       "type": "string"
      },
      "resource": {
       "type": "object"
      },
      "x402Version": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "signed": false,
  "accepts": [
   {
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "payTo": {
     "kind": "eoa",
     "address": "0xa26f...8147"
    },
    "amount": "100000",
    "checks": [
     {
      "check": "scheme",
      "level": "ok",
      "detail": "scheme=exact"
     }
    ],
    "scheme": "exact",
    "network": "eip155:8453",
    "verdict": "ok",
    "amountUsdc": 0.1,
    "maxTimeoutSeconds": 300
   }
  ],
  "reasons": [],
  "verdict": "ok",
  "resource": {
   "url": "https://x402-research-iota.vercel.app/api/firm/risk-snapshot"
  },
  "x402Version": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-invoice-decode-validator-e0bcb7b9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-research-iota.vercel.app](https://www.zero.xyz/host/x402-research-iota.vercel.app/llms.txt)
