{
  "openapi": "3.1.0",
  "info": {
    "title": "Solihull House Clearance enquiry API",
    "version": "1.0.0",
    "description": "Public same-origin form endpoint for house clearance quotes and contact messages. Not an authenticated partner API."
  },
  "servers": [
    {
      "url": "https://solihullhouseclearance.co.uk"
    }
  ],
  "paths": {
    "/api/quote/": {
      "get": {
        "summary": "Redirect to the quote form",
        "responses": {
          "303": {
            "description": "Redirects browsers to /request-a-quote/."
          }
        }
      },
      "post": {
        "summary": "Submit a quote or contact enquiry",
        "description": "Accepts form fields from this website only. Send Accept: application/json for a JSON result. Other clients are redirected back to the form or to /thank-you/.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Enquiry"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Enquiry"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON clients receive a thank-you redirect target.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "redirect": {
                      "type": "string",
                      "examples": ["/thank-you/"]
                    }
                  }
                }
              }
            }
          },
          "303": {
            "description": "HTML clients are sent to /thank-you/ or back to the form with ?error=."
          },
          "400": {
            "description": "Validation failed."
          },
          "403": {
            "description": "Request did not come from this website."
          },
          "429": {
            "description": "Too many requests from this address."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Enquiry": {
        "type": "object",
        "required": ["name", "email", "telephone"],
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "telephone": { "type": "string" },
          "postcode": {
            "type": "string",
            "description": "Required for quote enquiries. UK postcode such as B91 3QJ."
          },
          "propertyType": { "type": "string" },
          "clearanceType": { "type": "string" },
          "propertySize": { "type": "string" },
          "timeframe": { "type": "string" },
          "description": { "type": "string" },
          "formType": {
            "type": "string",
            "enum": ["quote", "contact"]
          }
        }
      }
    }
  }
}
