{
  "$schema": "https://agentsjson.org/schemas/v0.1.0/agents.schema.json",
  "agentsJson": "0.1.0",
  "info": {
    "title": "Cryptocardium agent surface",
    "version": "1.0.0",
    "description": "Action contracts for autonomous AI agents to manage no-KYC crypto-funded Visa and Mastercard cards via the Cryptocardium platform. Built on OpenAPI 3.1 plus a Model Context Protocol server. Agents authenticate with a Bearer account token (POST /agent-api.php?action=account) and can fund balances gaslessly via x402 (USDC on Base).",
    "contact": {
      "name": "Cryptocardium",
      "url": "https://cryptocardium.com/contact"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://cryptocardium.com/legal"
    }
  },
  "sources": [
    {
      "id": "rest",
      "path": "https://cryptocardium.com/openapi.json",
      "type": "openapi"
    },
    {
      "id": "mcp",
      "path": "https://cryptocardium.com/.well-known/mcp/server-card.json",
      "type": "mcp"
    }
  ],
  "flows": [
    {
      "id": "issue_card_funded_with_crypto",
      "title": "Issue a virtual card funded with crypto",
      "description": "End-to-end flow: create account (if needed), generate a deposit address for a chosen crypto asset, wait for on-chain confirmation, then issue and load a virtual Visa or Mastercard. Typical end-to-end time: under sixty seconds once the deposit confirms.",
      "actions": [
        { "id": "create_account", "sourceId": "rest", "operationId": "create_account" },
        { "id": "create_topup", "sourceId": "rest", "operationId": "create_topup" },
        { "id": "poll_topup", "sourceId": "rest", "operationId": "get_topup" },
        { "id": "issue_card", "sourceId": "rest", "operationId": "issue_card" },
        { "id": "load_card", "sourceId": "rest", "operationId": "load_card" }
      ],
      "fields": {
        "parameters": [
          { "name": "asset", "description": "Cryptocurrency to fund with (BTC, ETH, USDT, USDC, SOL, XMR, etc.)", "required": true },
          { "name": "chain", "description": "On-chain network for stablecoins (ethereum, tron, solana, etc.)" },
          { "name": "amount_usd", "description": "Target USD-equivalent value to deposit", "required": true },
          { "name": "bin", "description": "BIN range — 416842 ads, 557213 premium, 489517 wallet-optimised, 472305 SaaS", "required": true },
          { "name": "wallet_provision", "description": "Provision to apple_pay, google_pay, or both" }
        ]
      }
    },
    {
      "id": "spend_and_reconcile",
      "title": "Spend and reconcile a card from an agent",
      "description": "Read transaction history, raise a dispute on a charge if needed, attach evidence, and pull a unified activity stream.",
      "actions": [
        { "id": "list_transactions", "sourceId": "rest", "operationId": "list_transactions" },
        { "id": "get_transaction", "sourceId": "rest", "operationId": "get_transaction" },
        { "id": "file_dispute", "sourceId": "rest", "operationId": "file_dispute" },
        { "id": "add_dispute_evidence", "sourceId": "rest", "operationId": "add_dispute_evidence" },
        { "id": "get_activity", "sourceId": "rest", "operationId": "get_activity" }
      ]
    },
    {
      "id": "manage_card_lifecycle",
      "title": "Manage card lifecycle programmatically",
      "description": "Freeze, unfreeze, reissue, set limits, set MCC rules, or geo-lock a card from an agent. All operations are idempotent and reversible (except cancel).",
      "actions": [
        { "id": "freeze_card", "sourceId": "rest", "operationId": "freeze_card" },
        { "id": "unfreeze_card", "sourceId": "rest", "operationId": "unfreeze_card" },
        { "id": "replace_card", "sourceId": "rest", "operationId": "replace_card" },
        { "id": "set_card_limits", "sourceId": "rest", "operationId": "set_card_limits" },
        { "id": "set_mcc_rules", "sourceId": "rest", "operationId": "set_mcc_rules" },
        { "id": "set_card_geo", "sourceId": "rest", "operationId": "set_card_geo" },
        { "id": "cancel_card", "sourceId": "rest", "operationId": "cancel_card" }
      ]
    },
    {
      "id": "subscribe_webhooks",
      "title": "Subscribe to lifecycle events via webhooks",
      "description": "Register HTTPS webhook endpoints to receive HMAC-signed events for authorisations, captures, refunds, disputes and top-up state changes.",
      "actions": [
        { "id": "create_webhook", "sourceId": "rest", "operationId": "create_webhook" },
        { "id": "list_webhooks", "sourceId": "rest", "operationId": "list_webhooks" },
        { "id": "update_webhook", "sourceId": "rest", "operationId": "update_webhook" },
        { "id": "delete_webhook", "sourceId": "rest", "operationId": "delete_webhook" },
        { "id": "replay_webhook", "sourceId": "rest", "operationId": "replay_webhook" }
      ]
    }
  ],
  "x402": {
    "supported": true,
    "mode": "exact",
    "default_asset": "USDC",
    "default_network": "base",
    "endpoint": "https://cryptocardium.com/agent-api.php?action=topup",
    "auth": "Bearer — POST https://cryptocardium.com/agent-api.php?action=account returns { account_token }",
    "flow": "POST /agent-api.php?action=account for a Bearer token; POST /agent-api.php?action=topup with 'Authorization: Bearer <token>' and 'X-Payment-Mode: x402' to receive an HTTP 402 'accepts' block; sign the EIP-3009 USDC authorization and re-send the same request with the 'X-PAYMENT' header. Settlement is gasless for the agent; the balance is credited after the swap confirms.",
    "documentation": "https://cryptocardium.com/api#x402"
  }
}
