{
  "openapi": "3.1.0",
  "info": {
    "title": "Ninpo Snacks Public API",
    "version": "1.0.0",
    "description": "On-demand late night snack and cold drink delivery logistics and agentic commerce API for Southwest Detroit.",
    "contact": {
      "name": "Ninpo Snacks Operations",
      "url": "https://ninposnacks.com"
    }
  },
  "x-service-info": {
    "categories": [
      "food-and-beverage",
      "convenience-store",
      "e-commerce",
      "delivery"
    ],
    "description": "Ninpo Snacks on-demand late night snack and cold drink delivery logistics and agentic commerce API for Southwest Detroit."
  },
  "servers": [
    {
      "url": "https://api.ninposnacks.com",
      "description": "Production API Server"
    },
    {
      "url": "https://ninposnacks.com",
      "description": "Production Web Origin"
    }
  ],
  "paths": {
    "/healthz": {
      "get": {
        "summary": "System Health Status",
        "description": "Liveness and database connectivity health probe.",
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string", "example": "ok" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/readyz": {
      "get": {
        "summary": "Readiness Probe",
        "description": "Service readiness probe verifying Redis, MongoDB, and workers.",
        "responses": {
          "200": {
            "description": "Ready",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ready": { "type": "boolean", "example": true }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products": {
      "get": {
        "summary": "Search Product Catalog",
        "description": "Query active items, prices, Michigan bottle deposit status, and inventory.",
        "parameters": [
          { "name": "search", "in": "query", "schema": { "type": "string" } },
          { "name": "category", "in": "query", "schema": { "type": "string" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 20 } }
        ],
        "responses": {
          "200": {
            "description": "List of active products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "products": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mcp": {
      "post": {
        "summary": "Model Context Protocol (MCP) Endpoint",
        "description": "JSON-RPC 2.0 and Modern Streamable HTTP endpoint for AI tool calling.",
        "responses": {
          "200": { "description": "MCP response stream or message" }
        }
      }
    },
    "/api/v1/acp/checkout": {
      "post": {
        "summary": "Agentic Commerce Protocol (ACP) Checkout",
        "description": "Stripe Shared Payment Granted Token settlement endpoint.",
        "x-payment-info": {
          "intent": "charge",
          "method": "stripe",
          "amount": 10.00,
          "currency": "USD",
          "description": "Agentic Commerce Protocol checkout payment charge"
        },
        "responses": {
          "200": { "description": "Order confirmed" }
        }
      }
    },
    "/ucp/v1/checkout-sessions": {
      "post": {
        "summary": "Universal Commerce Protocol (UCP) Checkout Session",
        "description": "Google AI Mode / UCP checkout session creator.",
        "x-payment-info": {
          "intent": "session",
          "method": "stripe",
          "amount": 10.00,
          "currency": "USD",
          "description": "Universal Commerce Protocol checkout session"
        },
        "responses": {
          "200": { "description": "Checkout session created" }
        }
      }
    },
    "/api/v1/orders/checkout": {
      "post": {
        "summary": "Ninpo Snack Delivery Checkout",
        "description": "Create snack order and process card payment via Stripe.",
        "x-payment-info": {
          "intent": "charge",
          "method": "stripe",
          "amount": 10.00,
          "currency": "USD",
          "description": "Direct snack delivery order checkout charge"
        },
        "responses": {
          "200": { "description": "Order confirmed and charged" }
        }
      }
    },
    "/api/v1/payments/create-intent": {
      "post": {
        "summary": "Create Payment Intent Session",
        "description": "Create Stripe PaymentIntent session for snack checkout.",
        "x-payment-info": {
          "intent": "session",
          "method": "stripe",
          "amount": 10.00,
          "currency": "USD",
          "description": "Stripe PaymentIntent session creation"
        },
        "responses": {
          "200": { "description": "PaymentIntent client secret returned" }
        }
      }
    }
  }
}
