{
  "openapi": "3.1.0",
  "info": {
    "title": "Latex Pillow Shop public catalog API",
    "version": "1.0.0",
    "description": "Read-only, machine-readable catalog, policies, and FAQs for Latex Pillow Shop. Generated statically from the product content. No authentication. Prices in GBP and include VAT."
  },
  "servers": [
    {
      "url": "https://www.latexpillowshop.co.uk"
    }
  ],
  "paths": {
    "/api/products.json": {
      "get": {
        "summary": "Full product catalog",
        "operationId": "getProducts",
        "responses": {
          "200": {
            "description": "The full public catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "store": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/products/{slug}.json": {
      "get": {
        "summary": "A single product by slug",
        "operationId": "getProduct",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "No product with that slug"
          }
        }
      }
    },
    "/api/policies.json": {
      "get": {
        "summary": "Store policies (shipping, returns, privacy, terms)",
        "operationId": "getPolicies",
        "responses": {
          "200": {
            "description": "Public policies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/Policy"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/faq.json": {
      "get": {
        "summary": "Frequently asked questions",
        "operationId": "getFaq",
        "responses": {
          "200": {
            "description": "FAQ entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "faqs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Faq"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "compare_at_price": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "example": "GBP"
          },
          "availability": {
            "type": "string",
            "example": "in_stock"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "colors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "materials": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dimensions": {
            "type": [
              "object",
              "null"
            ]
          },
          "weight": {
            "type": [
              "string",
              "null"
            ]
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "description_short": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "llm_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "returnable": {
            "type": "boolean"
          },
          "shipping_profile": {
            "type": "string"
          },
          "warranty": {
            "type": [
              "string",
              "null"
            ]
          },
          "brand": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      },
      "Policy": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Faq": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
