{
  "openapi": "3.1.2",
  "info": {
    "title": "Jar of Trouble Public Storefront API",
    "version": "1.0.0",
    "description": "Read-only catalog, product, bundle, and shipping information. Prices and shipping rates are in US cents. Check the storefront for the final checkout total."
  },
  "servers": [
    {
      "url": "https://jaroftrouble.com"
    }
  ],
  "paths": {
    "/api/catalog": {
      "get": {
        "operationId": "listCatalog",
        "summary": "List published products and categories",
        "responses": {
          "200": {
            "description": "Public storefront data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "edits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "edit": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "size": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "sku": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "groupName": {
                            "type": "string"
                          },
                          "defaultSku": {
                            "type": "string"
                          },
                          "priceCents": {
                            "type": "integer"
                          },
                          "salePriceCents": {
                            "type": "integer"
                          },
                          "available": {
                            "type": "integer"
                          },
                          "allowBackorder": {
                            "type": "integer"
                          },
                          "optionNames": {
                            "type": "string",
                            "description": "JSON-encoded option names."
                          },
                          "optionValues": {
                            "type": "string",
                            "description": "JSON-encoded option values."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/products/{id}/details": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Product ID from the catalog.",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getProductDetails",
        "summary": "Read product ingredients, directions, and sensory information",
        "responses": {
          "200": {
            "description": "Public storefront data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "directionsEnglish": {
                      "type": "string"
                    },
                    "directionsFrench": {
                      "type": "string"
                    },
                    "ingredients": {
                      "type": "string"
                    },
                    "featuredIngredients": {
                      "type": "string"
                    },
                    "sensoryLabel": {
                      "type": "string"
                    },
                    "sensoryNotes": {
                      "type": "string"
                    },
                    "sensoryDescription": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/rituals": {
      "get": {
        "operationId": "listBlendSets",
        "summary": "List signature sets and their product order",
        "responses": {
          "200": {
            "description": "Public storefront data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "rituals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ritual": {
                            "type": "string"
                          },
                          "step": {
                            "type": "integer"
                          },
                          "product": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/shipping-options": {
      "get": {
        "operationId": "listShippingOptions",
        "summary": "List available shipping methods, rates, and carrier transit estimates",
        "responses": {
          "200": {
            "description": "Public storefront data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "priceCents": {
                            "type": "integer"
                          },
                          "freeOverCents": {
                            "type": "integer",
                            "description": "Minimum subtotal for free shipping. A negative value means no free-shipping threshold."
                          },
                          "daysMin": {
                            "type": "integer",
                            "description": "Minimum carrier transit in business days after dispatch."
                          },
                          "daysMax": {
                            "type": "integer",
                            "description": "Maximum carrier transit in business days after dispatch."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/products/{id}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Published product, stock, sale price and options",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public record"
          }
        }
      }
    },
    "/api/formula/{id}": {
      "get": {
        "operationId": "getFormula",
        "summary": "Ingredients, serving estimate, preparation and allergens",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public record"
          }
        }
      }
    },
    "/api/page": {
      "get": {
        "operationId": "getPageMetadata",
        "summary": "Public canonical metadata and social previews",
        "parameters": [
          {
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public record"
          }
        }
      }
    }
  }
}
