{
  "openapi": "3.1.0",
  "info": {
    "title": "edicola.shop Agent & Commerce API",
    "version": "1.0.0",
    "description": "Public API surface for AI agents shopping at edicola.shop. Includes free discovery endpoints (search, catalog, llms.txt) and payable agent-native endpoints. MPP payment discovery: payable operations carry x-payment-info extensions.",
    "contact": {
      "name": "edicola.shop",
      "url": "https://edicola.shop/contacts/",
      "email": "info@edicola.shop"
    }
  },
  "servers": [
    { "url": "https://edicola.shop" }
  ],
  "x-service-info": {
    "name": "edicola.shop",
    "categories": ["ecommerce", "magazines", "catalog", "agentic-commerce"],
    "currencies": ["EUR"],
    "country": "IT"
  },
  "paths": {
    "/catalogsearch/result/": {
      "get": {
        "summary": "Free human/agent search",
        "operationId": "freeSearch",
        "parameters": [
          { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "HTML/Markdown search results" }
        }
      }
    },
    "/mcp/": {
      "post": {
        "summary": "MCP JSON-RPC entry (catalog/category/markdown skills)",
        "operationId": "mcpRpc",
        "responses": {
          "200": { "description": "MCP JSON-RPC response" }
        }
      }
    },
    "/api-agent/premium-search": {
      "get": {
        "summary": "Premium agent-native search (x402)",
        "operationId": "premiumSearch",
        "parameters": [
          { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } }
        ],
        "x-payment-info": {
          "intent": "charge",
          "method": "x402",
          "amount": "0.01",
          "currency": "EUR",
          "description": "Premium search with publisher metadata and arretrato availability"
        },
        "responses": {
          "200": { "description": "Search results" },
          "402": { "description": "Payment Required — x402 challenge body" }
        }
      }
    },
    "/api-agent/ucp/checkout": {
      "post": {
        "summary": "Initiate UCP/Stripe checkout (delegated)",
        "operationId": "ucpCheckout",
        "x-payment-info": {
          "intent": "session",
          "method": "stripe",
          "amount": "variable",
          "currency": "EUR",
          "description": "Cart-driven checkout session, paid via Stripe Checkout"
        },
        "responses": {
          "200": { "description": "Checkout session URL" }
        }
      }
    },
    "/api-agent/acp/checkout/init": {
      "post": {
        "summary": "Initiate ACP checkout (delegated to traditional flow)",
        "operationId": "acpCheckoutInit",
        "x-payment-info": {
          "intent": "session",
          "method": "card",
          "amount": "variable",
          "currency": "EUR",
          "description": "ACP-shaped checkout init, finalised in /onestepcheckout (Stripe + PayPal supported)"
        },
        "responses": {
          "200": { "description": "Checkout session URL" }
        }
      }
    }
  },
  "components": {}
}
