{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/up2itnow0822/agentpay-mcp/docs/x402-chain-neutral-gateway-profile.schema.json",
  "title": "x402 chain-neutral gateway profile",
  "type": "object",
  "required": ["serviceName", "x402Version", "paymentHeader", "receiptHeader", "networks", "settlement", "trial", "refund", "manifests"],
  "properties": {
    "serviceName": { "type": "string", "minLength": 1 },
    "x402Version": { "oneOf": [{ "type": "number" }, { "type": "string", "minLength": 1 }] },
    "paymentHeader": { "const": "Payment-Signature" },
    "receiptHeader": { "const": "payment-response" },
    "networks": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["network", "name", "gateway"],
        "properties": {
          "network": { "type": "string", "pattern": "^[a-z0-9-]+:.+" },
          "name": { "type": "string", "minLength": 1 },
          "gateway": { "type": "string", "format": "uri" },
          "namespace": { "enum": ["eip155", "solana", "tvm", "ton", "other"] },
          "settlementAsset": { "type": "string" },
          "settlementChainId": { "oneOf": [{ "type": "number" }, { "type": "string" }] },
          "notes": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "facilitator": { "type": "string", "format": "uri" },
    "settlement": {
      "type": "object",
      "required": ["custody", "description"],
      "properties": {
        "custody": { "enum": ["non-custodial", "facilitator", "managed", "unknown"] },
        "description": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "trial": {
      "type": "object",
      "required": ["enabled", "description"],
      "properties": {
        "enabled": { "type": "boolean" },
        "calls": { "type": "number", "minimum": 0 },
        "description": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "refund": {
      "type": "object",
      "required": ["supported", "mode", "description"],
      "properties": {
        "supported": { "type": "boolean" },
        "mode": { "enum": ["automatic", "manual", "none"] },
        "description": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "manifests": {
      "type": "object",
      "required": ["wellKnownX402"],
      "properties": {
        "wellKnownX402": { "type": "string", "format": "uri" },
        "glama": { "type": "string", "format": "uri" },
        "smithery": { "type": "string", "format": "uri" },
        "mcpCatalog": { "type": "string", "format": "uri" },
        "openapi": { "type": "string", "format": "uri" },
        "llmsTxt": { "type": "string", "format": "uri" }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
