{
  "openapi": "3.1.0",
  "info": {
    "title": "Sosoft Beds Product And Content API",
    "version": "1.0.0",
    "description": "Enriched product and content data for SSR, AI agents, JSON-LD, product comparison, blog context, CMS pages, and feeds."
  },
  "externalDocs": {
    "description": "Source repository",
    "url": "https://github.com/5starbeds/sosoftbeds-product-api"
  },
  "servers": [
    {
      "url": "https://api.sosoftbeds.co.uk"
    }
  ],
  "paths": {
    "/api/products": {
      "get": {
        "summary": "List paginated products",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated product index with slug API URLs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductIndex"
                },
                "example": {
                  "message": "Products index",
                  "total": 234,
                  "page": 1,
                  "page_size": 5,
                  "total_pages": 47,
                  "next_page": "https://api.sosoftbeds.co.uk/api/products?page=2&pageSize=5",
                  "products": [
                    {
                      "sku": "60cm-ottoman-bed",
                      "slug": "60cm-ottoman-bed",
                      "name": "60cm Ottoman Bed",
                      "brand": "Sosoft Beds",
                      "price": 299,
                      "currency": "GBP",
                      "availability": "IN_STOCK",
                      "canonical_url": "https://www.sosoftbeds.co.uk/60cm-ottoman-bed",
                      "api_url": "https://api.sosoftbeds.co.uk/api/products/60cm-ottoman-bed",
                      "markdown_url": "https://api.sosoftbeds.co.uk/api/products/60cm-ottoman-bed",
                      "categories": [
                        "Adjustable Beds"
                      ],
                      "image_count": 8,
                      "option_group_count": 29,
                      "tab_count": 7,
                      "tab_names": [
                        "Description",
                        "More Information",
                        "Dimensions",
                        "Assembly Instructions",
                        "Specification",
                        "FAQ"
                      ],
                      "related_product_count": 12,
                      "sort_group": {
                        "rank": 10,
                        "name": "bed_products"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/products/{slug}": {
      "get": {
        "summary": "Get enriched product data by slug or SKU",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product data with options, categories, images, JSON-LD, and semantic fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDetail"
                },
                "example": {
                  "id": 123,
                  "sku": "60cm-ottoman-bed",
                  "name": "60cm Ottoman Bed",
                  "brand": "Sosoft Beds",
                  "type_id": "simple",
                  "url_key": "60cm-ottoman-bed",
                  "canonical_url": "https://www.sosoftbeds.co.uk/60cm-ottoman-bed",
                  "meta_title": "60cm Ottoman Bed",
                  "meta_description": "Compact ottoman bed with configurable fabric, headboard and mattress options.",
                  "description": "Clean product description text from Magento and storefront tabs.",
                  "short_description": "Compact ottoman bed.",
                  "price": 299,
                  "sale_price": 249,
                  "currency": "GBP",
                  "in_stock": true,
                  "availability": "https://schema.org/InStock",
                  "stock_status": "IN_STOCK",
                  "image_url": "https://www.sosoftbeds.co.uk/media/catalog/product/example.jpg",
                  "images": [
                    "https://www.sosoftbeds.co.uk/media/catalog/product/example.jpg"
                  ],
                  "image_gallery": [
                    {
                      "url": "https://www.sosoftbeds.co.uk/media/catalog/product/example.jpg",
                      "label": "60cm Ottoman Bed",
                      "position": 1
                    }
                  ],
                  "categories": [
                    {
                      "id": 10,
                      "name": "Adjustable Beds",
                      "url_key": "adjustable-beds",
                      "url_path": "adjustable-beds",
                      "level": 2,
                      "url": "https://www.sosoftbeds.co.uk/adjustable-beds"
                    }
                  ],
                  "breadcrumbs": [
                    {
                      "category_id": 10,
                      "category_name": "Adjustable Beds",
                      "category_url_key": "adjustable-beds",
                      "category_url_path": "adjustable-beds"
                    }
                  ],
                  "custom_options": [
                    {
                      "title": "Headboard",
                      "required": false,
                      "option_id": 1001,
                      "uid": "custom-option-1001",
                      "dropdown_value": [
                        {
                          "title": "Floor Standing Headboard",
                          "option_type_id": 2001,
                          "price": 99,
                          "depends_on": [],
                          "images": [
                            "https://www.sosoftbeds.co.uk/media/options/headboard.jpg"
                          ]
                        }
                      ]
                    }
                  ],
                  "tabs": [
                    {
                      "title": "Dimensions",
                      "name": "dimensions",
                      "text": "Width: 60cm. Length: 190cm.",
                      "html": "<p>Width: 60cm. Length: 190cm.</p>"
                    }
                  ],
                  "tab_names": [
                    "Description",
                    "More Information",
                    "Dimensions",
                    "Assembly Instructions",
                    "Specification",
                    "FAQ"
                  ],
                  "dimensions": [
                    "Width: 60cm",
                    "Length: 190cm"
                  ],
                  "faqs": [
                    {
                      "question": "Can I choose a mattress?",
                      "answer": "Yes, compatible mattress options are available in the product options."
                    }
                  ],
                  "semantic": {
                    "summary": "Configurable ottoman bed product with pricing, options, dimensions, FAQs and category context."
                  },
                  "json_ld": {
                    "@context": "https://schema.org",
                    "@type": "Product",
                    "name": "60cm Ottoman Bed",
                    "sku": "60cm-ottoman-bed"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Product not found",
                  "slug": "missing-product"
                }
              }
            }
          }
        }
      }
    },
    "/api/products/{slug}/price": {
      "get": {
        "summary": "Calculate configured product price from selected custom option values",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "values",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated custom option value IDs, for example 134102,134103"
          }
        ],
        "responses": {
          "200": {
            "description": "Configured product price with selected option adjustments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductPriceResponse"
                },
                "example": {
                  "message": "Configured product price",
                  "sku": "60cm-ottoman-bed",
                  "slug": "60cm-ottoman-bed",
                  "name": "60cm Ottoman Bed",
                  "currency": "GBP",
                  "base_price": 1249,
                  "selected_options_total": 200,
                  "final_price": 1449,
                  "selected_options": [
                    {
                      "option_id": 9158,
                      "option_title": "Select Storage Box Size",
                      "value_id": 134102,
                      "value_title": "2ft6 - LxW - 75cmx50cm",
                      "price": 200,
                      "price_adjustment": 200
                    }
                  ],
                  "missing_required_options": [
                    {
                      "option_id": 1234,
                      "title": "Choose Your Bed Size"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Product not found",
                  "slug": "missing-product"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Calculate configured product price from a JSON option selection",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductPriceRequest"
              },
              "example": {
                "selected_options": [
                  {
                    "option_id": 9158,
                    "value_id": 134102
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configured product price with selected option adjustments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductPriceResponse"
                },
                "example": {
                  "message": "Configured product price",
                  "sku": "60cm-ottoman-bed",
                  "currency": "GBP",
                  "base_price": 1249,
                  "selected_options_total": 200,
                  "final_price": 1449
                }
              }
            }
          },
          "404": {
            "description": "Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Product not found",
                  "slug": "missing-product"
                }
              }
            }
          }
        }
      }
    },
    "/api/categories": {
      "get": {
        "summary": "List product categories",
        "responses": {
          "200": {
            "description": "Category index with product counts and sample product API URLs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryIndex"
                },
                "example": {
                  "message": "Categories index",
                  "total": 99,
                  "categories": [
                    {
                      "id": 10,
                      "name": "Adjustable Beds",
                      "slug": "adjustable-beds",
                      "url": "https://www.sosoftbeds.co.uk/adjustable-beds",
                      "level": 2,
                      "product_count": 42,
                      "products": [
                        {
                          "sku": "60cm-ottoman-bed",
                          "slug": "60cm-ottoman-bed",
                          "name": "60cm Ottoman Bed",
                          "brand": "Sosoft Beds",
                          "price": 299,
                          "currency": "GBP",
                          "availability": "IN_STOCK",
                          "canonical_url": "https://www.sosoftbeds.co.uk/60cm-ottoman-bed",
                          "api_url": "https://api.sosoftbeds.co.uk/api/products/60cm-ottoman-bed",
                          "markdown_url": "https://api.sosoftbeds.co.uk/api/products/60cm-ottoman-bed",
                          "categories": [
                            "Adjustable Beds"
                          ],
                          "image_count": 8,
                          "option_group_count": 29,
                          "tab_count": 7,
                          "tab_names": [
                            "Description",
                            "More Information",
                            "Dimensions",
                            "Assembly Instructions",
                            "Specification",
                            "FAQ"
                          ],
                          "related_product_count": 12,
                          "sort_group": {
                            "rank": 10,
                            "name": "bed_products"
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "summary": "Search products, CMS pages, and blog posts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results grouped into products and content pages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                },
                "example": {
                  "message": "Search results",
                  "query": "king size ottoman beds under 500",
                  "intent": {
                    "max_price": 500,
                    "size_terms": [
                      "king size"
                    ],
                    "product_terms": [
                      "ottoman"
                    ]
                  },
                  "total": 1,
                  "products": [
                    {
                      "sku": "60cm-ottoman-bed",
                      "slug": "60cm-ottoman-bed",
                      "name": "60cm Ottoman Bed",
                      "brand": "Sosoft Beds",
                      "price": 299,
                      "currency": "GBP",
                      "availability": "IN_STOCK",
                      "canonical_url": "https://www.sosoftbeds.co.uk/60cm-ottoman-bed",
                      "api_url": "https://api.sosoftbeds.co.uk/api/products/60cm-ottoman-bed",
                      "markdown_url": "https://api.sosoftbeds.co.uk/api/products/60cm-ottoman-bed",
                      "categories": [
                        "Adjustable Beds"
                      ],
                      "image_count": 8,
                      "option_group_count": 29,
                      "tab_count": 7,
                      "tab_names": [
                        "Description",
                        "More Information",
                        "Dimensions",
                        "Assembly Instructions",
                        "Specification",
                        "FAQ"
                      ],
                      "related_product_count": 12,
                      "sort_group": {
                        "rank": 10,
                        "name": "bed_products"
                      },
                      "score": 4
                    }
                  ],
                  "content_pages": []
                }
              }
            }
          }
        }
      }
    },
    "/api/content-pages": {
      "get": {
        "summary": "List CMS pages and blog posts",
        "responses": {
          "200": {
            "description": "Content page index with CMS page and blog post API URLs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentPageIndex"
                },
                "example": {
                  "message": "Content pages and blog posts index",
                  "total": 34,
                  "content_pages": [
                    {
                      "type": "cms_page",
                      "slug": "choose-your-adjustable-bed",
                      "title": "Choose Your Adjustable Bed",
                      "h1": "Choose Your Adjustable Bed",
                      "canonical_url": "https://www.sosoftbeds.co.uk/choose-your-adjustable-bed",
                      "api_url": "https://api.sosoftbeds.co.uk/api/content-pages/choose-your-adjustable-bed",
                      "markdown_url": "https://api.sosoftbeds.co.uk/api/content-pages/choose-your-adjustable-bed",
                      "word_count": 1200,
                      "heading_count": 8,
                      "link_count": 12
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/content-pages/{slug}": {
      "get": {
        "summary": "Get enriched content page data by slug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Content page data with cleaned HTML, text, headings, links, metadata, and source URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentPageDetail"
                },
                "example": {
                  "type": "cms_page",
                  "slug": "choose-your-adjustable-bed",
                  "title": "Choose Your Adjustable Bed",
                  "h1": "Choose Your Adjustable Bed",
                  "canonical_url": "https://www.sosoftbeds.co.uk/choose-your-adjustable-bed",
                  "meta_description": "Guide to choosing an adjustable bed.",
                  "html": "<h1>Choose Your Adjustable Bed</h1><p>Cleaned page content.</p>",
                  "text": "Cleaned page content for AI and search.",
                  "word_count": 1200,
                  "headings": [
                    {
                      "level": 1,
                      "text": "Choose Your Adjustable Bed"
                    }
                  ],
                  "links": [
                    {
                      "text": "Adjustable Beds",
                      "url": "https://www.sosoftbeds.co.uk/adjustable-beds"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Content page not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Content page not found",
                  "slug": "missing-page"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "LLM-readable API guide",
        "responses": {
          "200": {
            "description": "Markdown guide for AI agents",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                },
                "example": "# Sosoft Beds Product And Content API\n\nMachine-readable product catalogue, category index, CMS page index and blog content API for Sosoft Beds.\n\nGET /api/products\nGET /api/products/{slug}\nGET /api/categories\nGET /api/search?q="
              }
            }
          }
        }
      }
    },
    "/docs": {
      "get": {
        "summary": "Human-readable API docs",
        "responses": {
          "200": {
            "description": "HTML documentation page for humans and crawlers",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                },
                "example": "<!doctype html><html lang=\"en\"><head><title>Sosoft Beds Product And Content API Docs</title></head><body><h1>Sosoft Beds Product And Content API</h1></body></html>"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "ProductIndex": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          },
          "next_page": {
            "type": "string",
            "format": "uri"
          },
          "previous_page": {
            "type": "string",
            "format": "uri"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductSummary"
            }
          }
        },
        "required": [
          "message",
          "total",
          "page",
          "page_size",
          "total_pages",
          "products"
        ]
      },
      "ProductSummary": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "sale_price": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "availability": {
            "type": "string"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "api_url": {
            "type": "string",
            "format": "uri"
          },
          "markdown_url": {
            "type": "string",
            "format": "uri"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "image_count": {
            "type": "integer"
          },
          "option_group_count": {
            "type": "integer"
          },
          "tab_count": {
            "type": "integer"
          },
          "tab_names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "related_product_count": {
            "type": "integer"
          },
          "last_updated": {
            "type": "string"
          },
          "sort_group": {
            "$ref": "#/components/schemas/SortGroup"
          }
        },
        "required": [
          "sku",
          "slug",
          "name",
          "api_url"
        ]
      },
      "ProductDetail": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "type_id": {
            "type": "string"
          },
          "url_key": {
            "type": "string"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "meta_title": {
            "type": "string"
          },
          "meta_description": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "short_description": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "sale_price": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "in_stock": {
            "type": "boolean"
          },
          "availability": {
            "type": "string"
          },
          "stock_status": {
            "type": "string"
          },
          "weight": {
            "type": "number"
          },
          "rating_summary": {
            "type": "number"
          },
          "review_count": {
            "type": "integer"
          },
          "image_url": {
            "type": "string",
            "format": "uri"
          },
          "image_gallery": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Image"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "breadcrumbs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Breadcrumb"
            }
          },
          "custom_options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          },
          "sizes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          },
          "fabric_options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          },
          "colours": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tabs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductTab"
            }
          },
          "tab_names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "related_products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RelatedProduct"
            }
          },
          "faqs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Faq"
            }
          },
          "semantic": {
            "$ref": "#/components/schemas/SemanticProductData"
          },
          "json_ld": {
            "type": "object",
            "additionalProperties": true
          },
          "last_updated": {
            "type": "string"
          }
        },
        "required": [
          "sku",
          "name",
          "brand",
          "url_key",
          "canonical_url",
          "price",
          "currency"
        ]
      },
      "ProductPriceRequest": {
        "type": "object",
        "properties": {
          "selected_options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductPriceSelection"
            }
          },
          "selected_value_ids": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "values": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/ProductPriceSelection"
                }
              ]
            }
          }
        }
      },
      "ProductPriceSelection": {
        "type": "object",
        "properties": {
          "option_id": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "option_uid": {
            "type": "string"
          },
          "value_id": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "value_uid": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "ProductPriceResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "base_price": {
            "type": "number"
          },
          "selected_options_total": {
            "type": "number"
          },
          "final_price": {
            "type": "number"
          },
          "selected_options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductPriceAdjustment"
            }
          },
          "missing_required_options": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "message",
          "sku",
          "currency",
          "base_price",
          "selected_options_total",
          "final_price"
        ]
      },
      "ProductPriceAdjustment": {
        "type": "object",
        "properties": {
          "option_id": {
            "type": "integer"
          },
          "option_uid": {
            "type": "string"
          },
          "option_title": {
            "type": "string"
          },
          "value_id": {
            "type": "integer"
          },
          "value_uid": {
            "type": "string"
          },
          "value_title": {
            "type": "string"
          },
          "price_type": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "price_adjustment": {
            "type": "number"
          }
        }
      },
      "CategoryIndex": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategorySummary"
            }
          }
        },
        "required": [
          "message",
          "total",
          "categories"
        ]
      },
      "CategorySummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "level": {
            "type": "integer"
          },
          "product_count": {
            "type": "integer"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductSummary"
            }
          }
        },
        "required": [
          "name",
          "product_count",
          "products"
        ]
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "usage": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "intent": {
            "$ref": "#/components/schemas/SearchIntent"
          },
          "total": {
            "type": "integer"
          },
          "products": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ProductSummary"
                },
                {
                  "type": "object",
                  "properties": {
                    "score": {
                      "type": "number"
                    }
                  }
                }
              ]
            }
          },
          "content_pages": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ContentPageSummary"
                },
                {
                  "type": "object",
                  "properties": {
                    "score": {
                      "type": "number"
                    }
                  }
                }
              ]
            }
          }
        },
        "required": [
          "message",
          "query",
          "total",
          "products",
          "content_pages"
        ]
      },
      "SearchIntent": {
        "type": "object",
        "properties": {
          "max_price": {
            "type": "number"
          },
          "min_price": {
            "type": "number"
          },
          "size_terms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "product_terms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ContentPageIndex": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "content_pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentPageSummary"
            }
          }
        },
        "required": [
          "message",
          "total",
          "content_pages"
        ]
      },
      "ContentPageSummary": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cms_page",
              "blog_index",
              "blog_post"
            ]
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "h1": {
            "type": "string"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "api_url": {
            "type": "string",
            "format": "uri"
          },
          "markdown_url": {
            "type": "string",
            "format": "uri"
          },
          "word_count": {
            "type": "integer"
          },
          "heading_count": {
            "type": "integer"
          },
          "link_count": {
            "type": "integer"
          },
          "last_updated": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "slug",
          "title",
          "api_url"
        ]
      },
      "ContentPageDetail": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cms_page",
              "blog_index",
              "blog_post"
            ]
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "h1": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "meta_title": {
            "type": "string"
          },
          "meta_description": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "word_count": {
            "type": "integer"
          },
          "headings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Heading"
            }
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          },
          "cache_generated_at": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "slug",
          "title",
          "text"
        ]
      },
      "SortGroup": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "enum": [
              "bed_products",
              "mattresses",
              "other_products",
              "services",
              "order_swatches"
            ]
          }
        },
        "required": [
          "rank",
          "name"
        ]
      },
      "Image": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "label": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "disabled": {
            "type": "boolean"
          }
        },
        "required": [
          "url"
        ]
      },
      "Category": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "url_key": {
            "type": "string"
          },
          "url_path": {
            "type": "string"
          },
          "url_suffix": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "level": {
            "type": "integer"
          },
          "breadcrumbs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Breadcrumb"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "Breadcrumb": {
        "type": "object",
        "properties": {
          "category_id": {
            "type": "integer"
          },
          "category_name": {
            "type": "string"
          },
          "category_url_key": {
            "type": "string"
          },
          "category_url_path": {
            "type": "string"
          }
        }
      },
      "CustomOption": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "__typename": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "option_id": {
            "type": "integer"
          },
          "uid": {
            "type": "string"
          },
          "is_swatch": {
            "type": "boolean"
          },
          "dropdown_value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOptionValue"
            }
          },
          "radio_value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOptionValue"
            }
          },
          "multiple_value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOptionValue"
            }
          },
          "checkbox_value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOptionValue"
            }
          },
          "field_value": {
            "$ref": "#/components/schemas/CustomOptionValue"
          },
          "area_value": {
            "$ref": "#/components/schemas/CustomOptionValue"
          },
          "file_value": {
            "$ref": "#/components/schemas/CustomOptionValue"
          },
          "date_value": {
            "$ref": "#/components/schemas/CustomOptionValue"
          }
        },
        "required": [
          "title"
        ]
      },
      "CustomOptionValue": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "uid": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "option_type_id": {
            "type": "integer"
          },
          "price": {
            "type": "number"
          },
          "price_type": {
            "type": "string"
          },
          "depends_on": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "max_characters": {
            "type": "integer"
          },
          "file_extension": {
            "type": "string"
          }
        }
      },
      "ProductTab": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ]
      },
      "RelatedProduct": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url_key": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "format": "uri"
          },
          "price": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "Faq": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          }
        },
        "required": [
          "question",
          "answer"
        ]
      },
      "SemanticProductData": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "summary": {
            "type": "string"
          },
          "primary_category": {
            "type": "string"
          },
          "product_type": {
            "type": "string"
          },
          "key_features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "use_cases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Heading": {
        "type": "object",
        "properties": {
          "level": {
            "type": "integer",
            "minimum": 1,
            "maximum": 6
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "level",
          "text"
        ]
      },
      "Link": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "url"
        ]
      }
    }
  }
}