{
  "openapi": "3.1.0",
  "info": {
    "title": "The Pizza Bakery catering API",
    "version": "1.0.0",
    "description": "Recommend and price catering orders from The Pizza Bakery, 1741 Westcliff Dr, Newport Beach. Prices in USD including Newport Beach sales tax. Catalog: https://thepizzabakery.com/catering.json. Menu: https://thepizzabakery.com/menu.json."
  },
  "servers": [
    {
      "url": "https://thepizzabakery.com"
    }
  ],
  "paths": {
    "/api/quote": {
      "get": {
        "operationId": "quoteCateringGet",
        "summary": "Recommend and price a catering order",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "adults",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vegetarian",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "glutenFree",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "salad",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "knots",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dessert",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "drinks",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quote"
          }
        }
      },
      "post": {
        "operationId": "quoteCatering",
        "summary": "Recommend and price a catering order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string",
                    "description": "Plain-English event description, e.g. \"lunch for 35 Thursday at noon, 8 vegetarians, deliver\". Explicit fields override it."
                  },
                  "adults": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "kids": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "vegetarian": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "glutenFree": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "pizza",
                      "lunch",
                      "feast"
                    ],
                    "description": "pizza = pizza party, lunch = pizza + sub platters, feast = pizza + lasagna"
                  },
                  "salad": {
                    "type": "boolean"
                  },
                  "knots": {
                    "type": "boolean"
                  },
                  "dessert": {
                    "type": "boolean"
                  },
                  "drinks": {
                    "type": "boolean"
                  },
                  "delivery": {
                    "type": "boolean"
                  },
                  "lines": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    },
                    "description": "Explicit order instead of a recommendation. Keys: lg-cheese, lg-pepperoni, lg-long-island, lg-bowling-green, lg-bbq-chicken, lg-spicy-chicken, lg-white, lg-margherita, lg-chevre, lg-hanover, gf-cheese, lasagna-half, lasagna-full, pasta-half, pasta-full, garlic-bread-6, salad-half, salad-full, salad-deep, sub-platter, knots, cookies, drinks"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote with itemized order, tax, delivery, total and per-person price"
          }
        }
      }
    },
    "/api/catering-request": {
      "post": {
        "operationId": "requestCatering",
        "summary": "Send a catering request to the store. Staff confirm by phone or email before anything is charged. Only call this with the customer's explicit consent.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contact",
                  "event",
                  "lines"
                ],
                "properties": {
                  "contact": {
                    "type": "object",
                    "required": [
                      "name",
                      "phone",
                      "email"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "org": {
                        "type": "string"
                      },
                      "notes": {
                        "type": "string"
                      }
                    }
                  },
                  "event": {
                    "type": "object",
                    "properties": {
                      "adults": {
                        "type": "integer"
                      },
                      "kids": {
                        "type": "integer"
                      },
                      "date": {
                        "type": "string",
                        "format": "date"
                      },
                      "time": {
                        "type": "string",
                        "description": "HH:MM, 11:00–21:00"
                      },
                      "delivery": {
                        "type": "boolean"
                      },
                      "address": {
                        "type": "string"
                      }
                    }
                  },
                  "lines": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request received"
          },
          "503": {
            "description": "Online requests not enabled; call the store"
          }
        }
      }
    }
  }
}