{
  "openapi": "3.1.0",
  "info": {
    "title": "MB Heating Renewables LTD: boiler quote API",
    "version": "1.0.0",
    "description": "Fixed, fully installed boiler prices (materials, labour and 20% VAT included) from a Gas Safe registered engineer (No. 940780) based in Rishton, near Blackburn, Lancashire, UK, covering 15 miles. Prices match the instant quote tool on the website. AI assistants are welcome to use this API to quote for users and to hand them a pre-filled link or WhatsApp booking message.",
    "contact": {
      "name": "Mark, MB Heating Renewables LTD",
      "url": "https://mbheatingrenewables.co.uk"
    }
  },
  "servers": [
    {
      "url": "https://mbheatingrenewables.co.uk"
    }
  ],
  "paths": {
    "/api/quote": {
      "get": {
        "operationId": "getBoilerQuote",
        "summary": "Get fixed installed prices for a new boiler",
        "description": "Returns budget (combi jobs in homes under 5 beds / 3 baths), value, most popular and premium options, sorted by price, each with a WhatsApp reservation link. With no parameters it returns usage help.",
        "parameters": [
          {
            "name": "current",
            "in": "query",
            "required": true,
            "description": "Current boiler type. regular = heat-only with loft tanks; back = back boiler behind a fire.",
            "schema": {
              "type": "string",
              "enum": [
                "combi",
                "regular",
                "system",
                "back"
              ]
            }
          },
          {
            "name": "want",
            "in": "query",
            "required": false,
            "description": "Job type. combi \u2192 combiSwap; regular \u2192 regularToCombi | systemSwap; system \u2192 systemSwap | systemToCombi; back \u2192 backToCombi | systemSwap. Defaults to the first.",
            "schema": {
              "type": "string",
              "enum": [
                "combiSwap",
                "systemSwap",
                "regularToCombi",
                "systemToCombi",
                "backToCombi"
              ]
            }
          },
          {
            "name": "beds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1-2",
                "3",
                "4",
                "5+"
              ]
            },
            "description": "Bedrooms. Numbers like 2 or 6 are accepted and normalised."
          },
          {
            "name": "baths",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3+"
              ]
            },
            "description": "Total baths plus separate showers."
          },
          {
            "name": "move",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "same",
                "move"
              ],
              "default": "same"
            }
          },
          {
            "name": "flue",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "wall",
                "roof",
                "unsure"
              ],
              "default": "wall"
            }
          },
          {
            "name": "smart",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Add smart controls (Hive / tado / Nest)."
          },
          {
            "name": "postcode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "UK postcode to check the service area, e.g. BB1 4RG."
          }
        ],
        "responses": {
          "200": {
            "description": "Quote options",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quote": {
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "string"
                        },
                        "sizeBand": {
                          "type": "string"
                        },
                        "options": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tier": {
                                "type": "string",
                                "enum": [
                                  "budget",
                                  "value",
                                  "most popular",
                                  "premium"
                                ]
                              },
                              "brand": {
                                "type": "string"
                              },
                              "model": {
                                "type": "string"
                              },
                              "output": {
                                "type": "string"
                              },
                              "warrantyYears": {
                                "type": "integer"
                              },
                              "warranty": {
                                "type": "string"
                              },
                              "priceIncVat": {
                                "type": "integer"
                              },
                              "currency": {
                                "type": "string"
                              },
                              "priceDisplay": {
                                "type": "string"
                              },
                              "reserveViaWhatsApp": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          }
                        },
                        "includedInEveryPrice": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "serviceArea": {
                      "type": "object"
                    },
                    "openOnWebsite": {
                      "type": "string",
                      "format": "uri",
                      "description": "Opens the website quote tool with these answers pre-filled."
                    },
                    "nextSteps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "contact": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters. The body lists valid values."
          }
        }
      }
    },
    "/": {
      "post": {
        "operationId": "requestCallback",
        "summary": "Ask Mark to call back (Netlify form)",
        "description": "Submits a callback request. Only send this with the user's explicit permission and their real details.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "form-name",
                  "name",
                  "phone"
                ],
                "properties": {
                  "form-name": {
                    "type": "string",
                    "const": "callback"
                  },
                  "name": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "postcode": {
                    "type": "string"
                  },
                  "service": {
                    "type": "string",
                    "enum": [
                      "New boiler or boiler swap",
                      "Boiler conversion (tanks or back boiler to combi)",
                      "Full heating system",
                      "Large property / multiple bathrooms",
                      "Unvented hot water cylinder",
                      "Bathroom",
                      "Landlord gas safety certificate (CP12)",
                      "Smart controls or using less gas",
                      "Something else"
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          },
          "303": {
            "description": "Received, redirected to the thank-you page"
          }
        }
      }
    }
  }
}