{
  "openapi": "3.1.0",
  "info": {
    "title": "Amzy Agency Hauling & Capacity API",
    "version": "1.0.0",
    "description": "Deterministic API for live truck capacity, vision-assisted quoting, and instant dispatch booking across South King & Pierce Counties."
  },
  "servers": [
    {
      "url": "https://agency.amzy.me/api/v1",
      "description": "Production Agent Gateway"
    }
  ],
  "paths": {
    "/capacity": {
      "get": {
        "summary": "Check live truck capacity by ZIP code and date",
        "operationId": "verifyZipCapacity",
        "parameters": [
          { "name": "zip", "in": "query", "required": true, "schema": { "type": "string" } },
          { "name": "date", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }
        ],
        "responses": {
          "200": {
            "description": "Live truck capacity and arrival windows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": { "type": "boolean" },
                    "county": { "type": "string" },
                    "remaining_cubic_yards": { "type": "number" },
                    "next_available_slot": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/quote": {
      "post": {
        "summary": "Calculate algorithmic quote based on volume and materials",
        "operationId": "calculateQuote",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["zip", "fraction"],
                "properties": {
                  "zip": { "type": "string" },
                  "fraction": { "type": "string", "enum": ["min", "1/4", "1/2", "3/4", "full"] },
                  "heavy_materials": { "type": "boolean" },
                  "flight_of_stairs": { "type": "integer" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Itemized guaranteed quote"
          }
        }
      }
    },
    "/dispatch": {
      "post": {
        "summary": "Confirm dispatch reservation",
        "operationId": "bookDispatch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["quote_id", "address", "phone", "time_slot"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Booking confirmation with live tracking URL"
          }
        }
      }
    }
  }
}
