{
  "openapi": "3.1.0",
  "info": {
    "title": "PaidSync API",
    "version": "1.0.0",
    "description": "PaidSync is an MCP server that gives AI agents read and write access to Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads, GTM, GA4, and Google Merchant Center through 309 tools. Primary interface is MCP (Model Context Protocol). This OpenAPI document advertises HTTP-level discovery for tools that prefer REST-style schemas.",
    "contact": {
      "name": "PaidSync support",
      "email": "support@paidsync.ai",
      "url": "https://paidsync.ai"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://paidsync.ai/terms"
    }
  },
  "servers": [
    {
      "url": "https://paidsync.ai",
      "description": "PaidSync production"
    }
  ],
  "x-service-info": {
    "categories": ["ads", "marketing", "data", "developer-tools"],
    "docs": {
      "apiReference": "https://paidsync.ai/docs",
      "homepage": "https://paidsync.ai",
      "llms": "https://paidsync.ai/llms.txt",
      "mcp": "https://paidsync.ai/.well-known/mcp/server-card.json",
      "agentCard": "https://paidsync.ai/.well-known/agent-card.json"
    }
  },
  "x-mcp": {
    "endpoint": "https://paidsync.ai/mcp",
    "server_card": "https://paidsync.ai/.well-known/mcp/server-card.json",
    "agent_card": "https://paidsync.ai/.well-known/agent-card.json",
    "skills_index": "https://paidsync.ai/.well-known/agent-skills/index.json"
  },
  "x-mpp": {
    "discovery_version": "0.1",
    "agent_payment_supported": false,
    "human_billing_provider": "Stripe",
    "pricing_page": "https://paidsync.ai/pricing",
    "note": "PaidSync is human-billed. Agent-native MPP payment is on the roadmap."
  },
  "paths": {
    "/mcp": {
      "get": {
        "summary": "PaidSync MCP endpoint",
        "description": "Model Context Protocol endpoint. Use an MCP-compatible client (Claude, ChatGPT, Cursor, etc.) to connect. Authentication via OAuth2 (see /.well-known/oauth-authorization-server).",
        "x-payment-info": {
          "intent": "session",
          "method": "stripe",
          "amount": null,
          "currency": "USD",
          "description": "Subscription-based access. Free plan 15 calls/month, paid plans from $49/month."
        },
        "responses": {
          "200": {
            "description": "MCP server card and tool list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required. Use OAuth2 flow at /.well-known/oauth-authorization-server."
          },
          "402": {
            "description": "Payment required. Free tier exhausted (15 calls/month). Upgrade at /pricing."
          }
        }
      }
    },
    "/api/subscribe": {
      "post": {
        "summary": "Subscribe to a PaidSync plan",
        "description": "Human-authorized billing via Stripe Checkout. Returns a Stripe Checkout session URL.",
        "x-payment-info": {
          "intent": "session",
          "method": "stripe",
          "amount": null,
          "currency": "USD",
          "description": "Stripe Checkout session for subscription signup. Human-authorized."
        },
        "responses": {
          "200": { "description": "Returns Stripe Checkout session URL" }
        }
      }
    },
    "/api/v1": {
      "get": {
        "summary": "x402 payment-required entry point",
        "description": "Returns HTTP 402 with x402 v2 spec body. Agents that speak x402 use this to discover payment requirements.",
        "x-payment-info": {
          "intent": "charge",
          "method": "x402",
          "amount": "1000",
          "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "description": "x402 USDC payment on Base. Pilot. Human checkout fallback at https://paidsync.ai/pricing."
        },
        "responses": {
          "200": { "description": "Resource returned (when X-PAYMENT validates)" },
          "402": { "description": "Payment required. x402 v2 body with accepts[] array." }
        }
      }
    },
    "/payment": {
      "get": {
        "summary": "PaidSync payment and pricing discovery",
        "description": "Discovery endpoint for MPP-compatible agents. Returns the pricing model and human-billed checkout URL.",
        "x-payment-info": {
          "intent": "charge",
          "method": "stripe",
          "amount": "4900",
          "currency": "USD",
          "description": "Plus plan at $49/month. See https://paidsync.ai/pricing for full plan list."
        },
        "responses": {
          "200": {
            "description": "Payment discovery JSON",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/billing": {
      "get": {
        "summary": "PaidSync billing portal entry",
        "description": "Returns the human-authorized billing portal URL for existing customers.",
        "x-payment-info": {
          "intent": "session",
          "method": "stripe",
          "amount": null,
          "currency": "USD",
          "description": "Stripe customer portal for managing existing subscription. Human-authorized."
        },
        "responses": {
          "200": { "description": "Billing portal URL" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://paidsync.ai/oauth/authorize",
            "tokenUrl": "https://paidsync.ai/oauth/token",
            "scopes": {
              "mcp": "Full MCP access",
              "read": "Read-only access",
              "write": "Write access"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": ["mcp"]
    }
  ]
}
