Parse an x402 payment request
x402_parse_payment_requestFree. Decode one x402 v2 payment request (base64 PAYMENT-REQUIRED header, PaymentRequired JSON or MCP tool result) and list every accepts option with exact atomic and decimal amounts. Token addresses are compared with a limited reference list. status: parsed, ambiguous (options differ in recipient, network or amount; none is chosen), malformed or unsupported. Does not verify the merchant, authorize a transfer, assess fraud risk, or guarantee any payment. URLs in the input are never fetched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | Yes | The payment request. A string: the base64 PAYMENT-REQUIRED header value (a leading 'PAYMENT-REQUIRED:' is allowed) or JSON text. An object: the PaymentRequired JSON, or for transport mcp the tool result (structuredContent, _meta x402/error or content[0].text). | |
| transport | No | Where the request came from: http (402 response) or mcp (paid tool result). Default http. | http |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| note | Yes | ||
| terms | Yes | URL of the terms of service. | |
| errors | Yes | ||
| parsed | Yes | The decoded request with every accepts option (null unless status is parsed or ambiguous). | |
| status | Yes | parsed = the checked x402 v2 structure had no defects (not a statement about the merchant or whether to pay). ambiguous = options differ in recipient, network or amount; none was chosen. malformed / unsupported = could not be fully read. | |
| evidence | Yes | ||
| warnings | Yes | ||
| mismatches | Yes | ||
| provenance | Yes | Version and sources of the bundled asset table. | |
| comparisons | Yes | ||
| unsupported | Yes | ||
| decoded_from | Yes | ||
| checked_scope | Yes | ||
| payment_required_location | Yes |