{
  "openapi": "3.1.0",
  "info": {
    "title": "Sarvadic Herbal Agent & Commerce API",
    "version": "1.0.0",
    "description": "Official OpenAPI 3.1 specification for Sarvadic Herbal e-commerce, WebMCP agent tools, and machine-native payment interfaces.",
    "contact": {
      "name": "Sarvadic Herbal Customer & Agent Support",
      "email": "sarvadicherbal@gmail.com",
      "url": "https://sarvadicherbal.com"
    }
  },
  "servers": [
    {
      "url": "https://sarvadicherbal.com",
      "description": "Production Server"
    }
  ],
  "x-service-info": {
    "categories": [
      "e-commerce",
      "health-and-beauty",
      "ayurvedic-products",
      "agent-commerce",
      "payments"
    ],
    "agentSupport": {
      "webmcp": true,
      "acp": true,
      "ucp": true,
      "x402": true,
      "mpp": true
    }
  },
  "paths": {
    "/api/orders/pay": {
      "post": {
        "summary": "Settle order payment via agent protocols (x402 & MPP)",
        "description": "Executes programmatic payment settlement. Requires payment signature or challenge response.",
        "operationId": "settleOrderPayment",
        "x-payment-info": {
          "intent": "charge",
          "method": "tempo",
          "amount": "1.00",
          "currency": "USDC",
          "description": "Settles an order directly via Machine Payment Protocol (MPP) or x402 on Base network.",
          "offers": [
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1.00",
              "currency": "USDC",
              "description": "Tempo stablecoin settlement"
            },
            {
              "intent": "charge",
              "method": "stripe",
              "amount": "120.00",
              "currency": "INR",
              "description": "Direct card/UPI payment via Stripe"
            },
            {
              "intent": "charge",
              "method": "card",
              "amount": "1.50",
              "currency": "USD",
              "description": "Credit/Debit Card payment"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Payment successful and order placed"
          },
          "402": {
            "description": "Payment Required - challenge issued per x402 / MPP"
          }
        }
      },
      "get": {
        "summary": "Probe payment requirements for orders",
        "description": "Returns the HTTP 402 challenge describing current payment requirements and accepted tokens.",
        "operationId": "probePaymentRequirements",
        "x-payment-info": {
          "intent": "charge",
          "method": "tempo",
          "amount": "1.00",
          "currency": "USDC",
          "description": "Inspect payment requirements before initiating checkout."
        },
        "responses": {
          "402": {
            "description": "HTTP 402 challenge containing payment requirements"
          }
        }
      }
    },
    "/api/checkout": {
      "post": {
        "summary": "Calculate order totals and get payment options",
        "description": "Calculates order pricing, taxes, shipping, and returns available agent payment rails (x402, MPP, WhatsApp).",
        "operationId": "calculateCheckout",
        "x-payment-info": {
          "intent": "session",
          "method": "tempo",
          "amount": "1.00",
          "currency": "USDC",
          "description": "Initialize an order checkout session."
        },
        "responses": {
          "200": {
            "description": "Checkout details calculated successfully"
          }
        }
      }
    },
    "/api/catalog": {
      "get": {
        "summary": "Retrieve full product catalog",
        "description": "Returns the complete botanical catalog including pricing, volume, benefits, and ingredients.",
        "operationId": "getCatalog",
        "responses": {
          "200": {
            "description": "Product list retrieved successfully"
          }
        }
      }
    },
    "/api/agent/auth": {
      "post": {
        "summary": "Autonomous agent registration (Auth.md)",
        "description": "Enables agents to register autonomously via anonymous or identity assertion modes.",
        "operationId": "registerAgent",
        "responses": {
          "200": {
            "description": "Bearer credentials issued"
          }
        }
      }
    }
  }
}
