{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.agentscore.com/schemas/payment-handlers/x402.json",
  "title": "AgentScore x402 payment handler config (com.agentscore.payment.x402) v1",
  "description": "Schema for the `config` object of a `com.agentscore.payment.x402` payment handler binding inside a UCP profile's `payment_handlers`. Describes how a merchant accepts x402 USDC payments. x402 is a multi-chain protocol; the merchant's `networks` array enumerates which networks it accepts. Today AgentScore merchants ship `@x402/evm` (Base + Base Sepolia); x402 also publishes `@x402/svm` (Solana) and `@x402/stellar`, which an AgentScore merchant adopts by adding the relevant entry to `networks`. Each entry can optionally declare a static `recipient` for MITM cross-check. The wrapper fields are defined by UCP itself; this schema validates only the config payload.",
  "type": "object",
  "properties": {
    "networks": {
      "type": "array",
      "minItems": 1,
      "description": "List of x402 networks the merchant accepts. One entry per network.",
      "items": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "description": "Network identifier matching x402's network identifier convention. EVM uses `<chain>-<chain_id>` form, e.g. `base-8453` (mainnet) or `base-84532` (Base Sepolia). Solana uses `solana-mainnet-beta` / `solana-devnet`. Stellar uses `stellar-pubnet` / `stellar-testnet`."
          },
          "recipient": {
            "type": "string",
            "description": "Optional. Merchant's static settlement address on this network. When present, agents MAY cross-check the 402 challenge's `payTo` against this declared address as MITM protection. Omit if the merchant uses per-order recipients on this network — the authoritative recipient still ships in the 402 body."
          }
        },
        "required": ["network"],
        "additionalProperties": true
      }
    }
  },
  "required": ["networks"],
  "additionalProperties": true
}
