{
  "schemaVersion": "1.0.0",
  "name": "XPayr Open Agentic Commerce & Multi-Chain Payment Flows",
  "description": "Machine-readable agent workflow specification (agents.json) for XPayr non-custodial crypto payment gateway, Dual Checkout (Web3 1-Click + Direct Exchange QR), signed HMAC webhooks, ES256 wallet software licensing, and policy-controlled AI agent procurement.",
  "organization": {
    "name": "XPayr LLC",
    "url": "https://xpayr.com",
    "github": "https://github.com/xpayrcom",
    "supportEmail": "legal@xpayr.com"
  },
  "transports": {
    "mcpRemoteStreamableHttp": {
      "type": "streamable-http",
      "endpoint": "https://xpayr.com/api/mcp",
      "protocolVersions": ["2025-03-26", "2024-11-05"],
      "authentication": "Optional Bearer token (sk_test_... or sk_live_...) for merchant write actions; zero-auth supported for fee calculation, network discovery, and sandbox previews."
    },
    "mcpStdio": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@xpayr/mcp-server"],
      "npmPackage": "@xpayr/mcp-server",
      "npmAlias": "xpayr-mcp",
      "mcpRegistryId": "io.github.xpayrcom/xpayr-mcp-server",
      "glamaUrl": "https://glama.ai/mcp/servers/xpayrcom/xpayr-mcp-server",
      "dockerImage": "ghcr.io/xpayrcom/xpayr-mcp-server:latest"
    },
    "openapi": {
      "version": "3.1.0",
      "fullSpecUrl": "https://xpayr.com/.well-known/openapi.json",
      "gptActionsSpecUrl": "https://xpayr.com/public/docs/developers/xpayr-openapi-gpt-actions.json",
      "interactivePlaygroundUrl": "https://api-docs.xpayr.com/"
    }
  },
  "guardrails": {
    "custodyModel": "non_custodial_direct_wallet_settlement",
    "gatewayFeePercent": 0.5,
    "gatewayFeeBps": 50,
    "exchangeWithdrawalUnderpaymentTolerance": "1% up to $0.50 USD",
    "autonomousMainnetSpendPolicy": "Requires explicit merchant spend policy limits or human-in-the-loop approval via xpayr_approve_agent_payment_intent."
  },
  "flows": [
    {
      "id": "autonomous_checkout_and_fee_audit",
      "name": "Calculate 0.5% Gateway Fee & Create Dual Checkout Session",
      "description": "Computes exact 0.5% XPayr fee split vs competitors and creates a multi-chain checkout session supporting Web3 1-Click Pay and Direct Exchange QR transfer.",
      "steps": [
        {
          "step": 1,
          "tool": "xpayr_calculate_gateway_fee_and_split",
          "operationId": "calculateGatewayFeeAndSplit",
          "description": "Compute deterministic 0.5% gateway fee, 99.5% net merchant settlement, and $0.50 exchange withdrawal fee tolerance."
        },
        {
          "step": 2,
          "tool": "xpayr_create_payment_session",
          "operationId": "createPaymentSession",
          "description": "Create a hosted or embedded Dual Checkout session across TRON, Solana, Base, Polygon, BSC, Ethereum, or Arc."
        },
        {
          "step": 3,
          "tool": "xpayr_get_payment_session",
          "operationId": "getPaymentSession",
          "description": "Poll or verify on-chain settlement status and transaction hash."
        }
      ]
    },
    {
      "id": "multichain_payment_link_and_email_invoice",
      "name": "Generate Agnostic Multi-Chain Payment Link & Send Branded Email Invoice",
      "description": "Creates a Single-Use (30-min) or Reusable (1-year) payment link where the buyer selects their preferred network/token at checkout, then pushes an HTML email invoice.",
      "steps": [
        {
          "step": 1,
          "tool": "xpayr_create_payment_link",
          "operationId": "createPaymentLink",
          "description": "Create a universal multi-chain payment link."
        },
        {
          "step": 2,
          "tool": "xpayr_send_payment_link_email_invoice",
          "operationId": "sendPaymentLinkEmailInvoice",
          "description": "Dispatch a responsive HTML invoice email with a 1-click checkout CTA."
        }
      ]
    },
    {
      "id": "policy_controlled_agent_procurement",
      "name": "Human-in-the-Loop AI Agent Payment Intent & Approval Flow",
      "description": "Allows an autonomous AI agent to submit a payment intent within merchant budget guardrails and bridge approved intents into executable checkout sessions.",
      "steps": [
        {
          "step": 1,
          "tool": "xpayr_get_agent_spend_policy",
          "operationId": "getAgentSpendPolicy",
          "description": "Inspect active per-transaction and daily USDC/USDT spending limits."
        },
        {
          "step": 2,
          "tool": "xpayr_submit_agent_payment_intent",
          "operationId": "submitAgentPaymentIntent",
          "description": "Submit a structured procurement intent with vendor metadata and amount."
        },
        {
          "step": 3,
          "tool": "xpayr_approve_agent_payment_intent",
          "operationId": "approveAgentPaymentIntent",
          "description": "Approve the intent and bridge to a verifiable non-custodial checkout session."
        }
      ]
    },
    {
      "id": "wallet_software_license_issuance",
      "name": "ES256 Offline-Verifiable Wallet Software License Flow",
      "description": "Issues and verifies cryptographic ES256 JWS licenses bound to a customer wallet address for browser extensions, CLI tools, and SaaS apps.",
      "steps": [
        {
          "step": 1,
          "tool": "xpayr_issue_wallet_license",
          "operationId": "issueWalletLicense",
          "description": "Issue an ES256 JWS license token bound to the buyer wallet after checkout confirmation."
        }
      ]
    }
  ]
}
