{
  "openapi": "3.1.0",
  "info": {
    "title": "Front Range Plumbing Co. — booking API for AI assistants",
    "version": "0.1.0",
    "description": "Quote and book Front Range Plumbing Co.. Always confirm with the customer before booking."
  },
  "servers": [
    {
      "url": "https://doorhanger.ai/b/front-range-plumbing/api"
    }
  ],
  "paths": {
    "/info": {
      "get": {
        "operationId": "getBusinessInfo",
        "summary": "Business profile, services, prices, hours, credentials",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/service-area": {
      "get": {
        "operationId": "checkServiceArea",
        "summary": "Check a ZIP",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "required": true,
            "description": "5-digit ZIP",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/quote": {
      "get": {
        "operationId": "getQuote",
        "summary": "Instant price range",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": true,
            "description": "service id or plain-English job",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zip",
            "in": "query",
            "required": false,
            "description": "ZIP",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "urgency",
            "in": "query",
            "required": false,
            "description": "standard or emergency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/availability": {
      "get": {
        "operationId": "getAvailability",
        "summary": "Open start times",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "service id or description",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "1-21",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/book": {
      "post": {
        "operationId": "bookJob",
        "summary": "Book a job (customer must have confirmed)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service_id": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string",
                    "description": "\"YYYY-MM-DD HH:MM\" from get_availability"
                  },
                  "customer": {
                    "type": "object",
                    "description": "The person the job is for.",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string",
                        "description": "Mobile number for texts"
                      },
                      "email": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string",
                        "description": "Street address of the job"
                      },
                      "zip": {
                        "type": "string",
                        "description": "5-digit ZIP of the job"
                      }
                    },
                    "required": [
                      "name",
                      "phone",
                      "zip"
                    ]
                  },
                  "urgency": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "emergency"
                    ],
                    "default": "standard"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Problem description, gate codes, pets, photos links"
                  },
                  "customer_confirmed": {
                    "type": "boolean",
                    "description": "true only after the customer explicitly approved"
                  },
                  "assistant": {
                    "type": "string",
                    "description": "Name of the AI assistant making this booking (e.g. ChatGPT, Claude, Gemini)"
                  }
                },
                "required": [
                  "service_id",
                  "start",
                  "customer",
                  "customer_confirmed"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/booking-status": {
      "get": {
        "operationId": "getBookingStatus",
        "summary": "Booking status",
        "parameters": [
          {
            "name": "booking_id",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirmation_code",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}