{
  "openapi": "3.1.0",
  "info": {
    "title": "AnyHauler Public API",
    "version": "1.0.0",
    "description": "Read-only, unauthenticated API for AnyHauler dumpster trailer rental in Columbus & Central Ohio. Lets agents check service-area coverage and quote real pricing by ZIP code.",
    "contact": { "name": "AnyHauler", "email": "support@anyhauler.com", "url": "https://anyhauler.com" }
  },
  "servers": [{ "url": "https://anyhauler.com" }],
  "paths": {
    "/api/availability": {
      "get": {
        "operationId": "getAvailability",
        "summary": "Check service coverage and quote pricing for a ZIP code",
        "description": "Returns whether a ZIP is in the AnyHauler service area, the 5-yard and 7-yard trailer sizes with rental pricing and included weights, fee notes, and prohibited items. No payment is collected online; customers pay on delivery.",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "required": true,
            "description": "5-digit US ZIP code.",
            "schema": { "type": "string", "pattern": "^\\d{5}$", "example": "43230" }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Requested delivery date, YYYY-MM-DD. Optional; exact slots are confirmed at booking.",
            "schema": { "type": "string", "format": "date", "example": "2026-08-01" }
          }
        ],
        "responses": {
          "200": {
            "description": "Coverage and pricing result.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/AvailabilityResponse" }
              }
            }
          },
          "400": { "description": "Invalid or missing ZIP / date." },
          "429": { "description": "Rate limit exceeded (60 requests/minute per IP)." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TrailerSize": {
        "type": "object",
        "properties": {
          "size": { "type": "string", "example": "5-yard" },
          "name": { "type": "string", "example": "5-Yard Dumpster Trailer" },
          "includedWeightLbs": { "type": "integer", "example": 1500 },
          "pricing": {
            "type": "object",
            "properties": {
              "3-day": { "type": "number", "example": 179 },
              "1-week": { "type": "number", "example": 219 },
              "1-month": { "type": "number", "example": 379 }
            }
          },
          "overageFeePer1000Lbs": { "type": "number", "example": 30 },
          "bookingUrl": { "type": "string", "format": "uri" }
        }
      },
      "AvailabilityResponse": {
        "type": "object",
        "properties": {
          "business": { "type": "string", "example": "AnyHauler" },
          "legalName": { "type": "string", "example": "AnyHauler LLC" },
          "phone": { "type": "string", "example": "+1-614-404-0071" },
          "query": {
            "type": "object",
            "properties": {
              "zip": { "type": "string" },
              "date": { "type": ["string", "null"] }
            }
          },
          "serviceable": { "type": "boolean" },
          "region": { "type": "string", "example": "columbus-suburbs" },
          "currency": { "type": "string", "example": "USD" },
          "sizes": { "type": "array", "items": { "$ref": "#/components/schemas/TrailerSize" } },
          "fees": {
            "type": "object",
            "properties": {
              "deliveryFeeEstimate": { "type": "number", "example": 45 },
              "deliveryFeeNote": { "type": "string" },
              "includedDumps": { "type": "integer", "example": 1 },
              "extraDumpFeeNote": { "type": "string" }
            }
          },
          "availabilityNote": { "type": "string" },
          "prohibitedItems": { "type": "array", "items": { "type": "string" } },
          "bookingUrl": { "type": "string", "format": "uri" }
        }
      }
    }
  }
}
