{
  "openapi": "3.1.0",
  "info": {
    "title": "MaterialsHub Public API",
    "version": "1.0.0",
    "summary": "Material categories, indicative pricing and project inquiries.",
    "description": "MaterialsHub imports and distributes building and finishing materials in Greece — tiles, sanitary ware, marble, lighting and furniture — direct from the factories, and supplies them to homeowners, architects, contractors, hotels and shops alike.\n\nFree and unauthenticated. Rate limit: 60 requests per minute per IP on /api/public/*; contact us for higher volumes.",
    "contact": {
      "name": "MaterialsHub",
      "email": "find@materialshub.gr",
      "url": "https://materialshub.gr/contact"
    },
    "termsOfService": "https://materialshub.gr/terms",
    "x-telephone": "+306948408542",
    "x-rateLimit": {
      "requests": 60,
      "window": "1m",
      "policy": "60 requests per minute per IP on /api/public/*; contact us for higher volumes."
    }
  },
  "servers": [
    {
      "url": "https://materialshub.gr",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "materials",
      "description": "Material categories MaterialsHub imports and supplies."
    },
    {
      "name": "sales",
      "description": "Reach the MaterialsHub sales team."
    }
  ],
  "paths": {
    "/api/public/materials": {
      "get": {
        "operationId": "listMaterialCategories",
        "tags": [
          "materials"
        ],
        "summary": "List all material categories",
        "description": "Returns every material category with lead time, indicative supply price range and English/Greek page URLs.",
        "responses": {
          "200": {
            "description": "Material categories",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaterialList"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/materials/{slug}": {
      "get": {
        "operationId": "getMaterialCategory",
        "tags": [
          "materials"
        ],
        "summary": "Get one material category",
        "description": "Returns full detail for a single category: description, ranges, applications, specifications and FAQs.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Category slug.",
            "schema": {
              "type": "string",
              "enum": [
                "tiles",
                "marble",
                "natural-stone",
                "lighting",
                "heating",
                "sanitaryware",
                "flooring",
                "plumbing",
                "electrical",
                "paints",
                "openings",
                "insulation",
                "bathroom-furniture",
                "drywall",
                "underfloor-heating",
                "wood-flooring",
                "worktops",
                "pergolas-shading",
                "air-conditioning",
                "gas-boilers",
                "epoxy-flooring",
                "tile-adhesives",
                "thermal-insulation-etics",
                "waterproofing",
                "fireplaces-stoves",
                "decking",
                "glass-railings",
                "ironmongery",
                "shutters-screens",
                "masonry-renders",
                "solar-water-heating",
                "photovoltaics",
                "furniture",
                "wood-panels",
                "furniture-accessories",
                "home-appliances",
                "television",
                "security-cameras",
                "knx-smart-home",
                "spa-sauna",
                "jacuzzi",
                "electric-heating-appliances",
                "electrical-appliances",
                "outdoor-furniture",
                "outdoor-kitchens-bbq",
                "acoustic-insulation",
                "door-entry-intercom",
                "skirting-profiles",
                "suspended-ceilings",
                "kitchens-wardrobes",
                "pools"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Category detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaterialDetail"
                }
              }
            }
          },
          "404": {
            "description": "Unknown slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/inquiry": {
      "post": {
        "operationId": "submitProjectInquiry",
        "tags": [
          "sales"
        ],
        "summary": "Submit a project supply inquiry",
        "description": "Sends a supply inquiry to the MaterialsHub sales team. A specialist replies by email, usually within one working day.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Delivery temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {},
    "schemas": {
      "Price": {
        "type": "object",
        "description": "Indicative supply price range.",
        "properties": {
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "examples": [
              "EUR"
            ]
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure, e.g. m2, unit, m, kWp."
          }
        },
        "required": [
          "min",
          "max",
          "currency",
          "unit"
        ]
      },
      "MaterialSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "nameEl": {
            "type": "string"
          },
          "tagline": {
            "type": "string"
          },
          "leadTime": {
            "type": "string",
            "examples": [
              "1–2 wks"
            ]
          },
          "indicativePrice": {
            "$ref": "#/components/schemas/Price"
          },
          "urls": {
            "type": "object",
            "properties": {
              "en": {
                "type": "string",
                "format": "uri"
              },
              "el": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "required": [
          "slug",
          "name",
          "tagline",
          "leadTime",
          "urls"
        ]
      },
      "MaterialDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MaterialSummary"
          },
          {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "keywords": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "highlights": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "body": {
                      "type": "string"
                    }
                  }
                }
              },
              "ranges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "body": {
                      "type": "string"
                    }
                  }
                }
              },
              "specifications": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              },
              "applications": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "faqs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "q": {
                      "type": "string"
                    },
                    "a": {
                      "type": "string"
                    }
                  }
                }
              },
              "relatedCategories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        ]
      },
      "MaterialList": {
        "type": "object",
        "properties": {
          "supplier": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "telephone": {
                "type": "string"
              },
              "areaServed": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sameAs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "count": {
            "type": "integer"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MaterialSummary"
            }
          }
        },
        "required": [
          "count",
          "categories"
        ]
      },
      "InquiryRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "message"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          },
          "company": {
            "type": "string",
            "maxLength": 200
          },
          "phone": {
            "type": "string",
            "maxLength": 60
          },
          "project": {
            "type": "string",
            "maxLength": 300,
            "description": "Project name, type or location."
          },
          "categories": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "type": "string",
              "enum": [
                "tiles",
                "marble",
                "natural-stone",
                "lighting",
                "heating",
                "sanitaryware",
                "flooring",
                "plumbing",
                "electrical",
                "paints",
                "openings",
                "insulation",
                "bathroom-furniture",
                "drywall",
                "underfloor-heating",
                "wood-flooring",
                "worktops",
                "pergolas-shading",
                "air-conditioning",
                "gas-boilers",
                "epoxy-flooring",
                "tile-adhesives",
                "thermal-insulation-etics",
                "waterproofing",
                "fireplaces-stoves",
                "decking",
                "glass-railings",
                "ironmongery",
                "shutters-screens",
                "masonry-renders",
                "solar-water-heating",
                "photovoltaics",
                "furniture",
                "wood-panels",
                "furniture-accessories",
                "home-appliances",
                "television",
                "security-cameras",
                "knx-smart-home",
                "spa-sauna",
                "jacuzzi",
                "electric-heating-appliances",
                "electrical-appliances",
                "outdoor-furniture",
                "outdoor-kitchens-bbq",
                "acoustic-insulation",
                "door-entry-intercom",
                "skirting-profiles",
                "suspended-ceilings",
                "kitchens-wardrobes",
                "pools"
              ]
            }
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "agent": {
            "type": "string",
            "maxLength": 120,
            "description": "Name of the agent submitting on a user's behalf."
          }
        },
        "additionalProperties": false
      },
      "InquiryResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "ok"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}