{
  "openapi": "3.1.0",
  "info": {
    "title": "Fuoco Antico Public Ordering & AI Agent API",
    "version": "1.1.0",
    "description": "Public HTTPS API for querying the live Fuoco Antico wood-fired menu, available oven-throttled pickup slots, LLM catalog manifest, and submitting or tracking customer pickup orders."
  },
  "servers": [
    {
      "url": "https://scintilla.brobotindustries.com/be",
      "description": "Production Scintilla Storefront Ordering API"
    }
  ],
  "paths": {
    "/public-api.php": {
      "get": {
        "operationId": "queryStorefrontOrOrderStatus",
        "summary": "Fetch live menu, LLM manifest, storefront state, or order status",
        "parameters": [
          {
            "name": "funct",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get_llm_manifest",
                "get_live_storefront",
                "check_storefront_state",
                "get_order_status"
              ]
            },
            "description": "Use get_llm_manifest or get_live_storefront to fetch the full menu and pickup slots; use get_order_status to track an order."
          },
          {
            "name": "tenant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "fuoco-antica"
            }
          },
          {
            "name": "order_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Order number (e.g. FA-1001) when funct=get_order_status"
          },
          {
            "name": "customer_phone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "10-digit customer phone number when funct=get_order_status"
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response with result=\"Success\" and data payload"
          }
        }
      },
      "post": {
        "operationId": "placePickupOrder",
        "summary": "Submit a customer pickup order to Fuoco Antico",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "funct",
                  "tenant",
                  "customer_name",
                  "customer_phone",
                  "cart_items_json"
                ],
                "properties": {
                  "funct": {
                    "type": "string",
                    "enum": [
                      "place_order"
                    ],
                    "default": "place_order"
                  },
                  "tenant": {
                    "type": "string",
                    "default": "fuoco-antica"
                  },
                  "customer_name": {
                    "type": "string",
                    "description": "Customer full name for pickup"
                  },
                  "customer_phone": {
                    "type": "string",
                    "description": "10-digit US mobile phone number"
                  },
                  "customer_email": {
                    "type": "string",
                    "description": "Optional email address for order receipt"
                  },
                  "pickup_slot_time": {
                    "type": "string",
                    "default": "ASAP",
                    "description": "ASAP or HH:MM slot from pickup_slots"
                  },
                  "customer_notes": {
                    "type": "string",
                    "description": "Optional kitchen or pickup notes"
                  },
                  "sms_opt_in": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "default": 0,
                    "description": "1 only if customer explicitly consented to SMS alerts"
                  },
                  "cart_items_json": {
                    "type": "string",
                    "description": "JSON string array of items: [{\"item_id\":15,\"name\":\"Margherita\",\"quantity\":1,\"unit_price\":15,\"modifiers\":[],\"special_notes\":\"\"}]"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order confirmation with order_number, status_token, and pickup summary"
          }
        }
      }
    }
  }
}
