{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cartcite.com/products.schema.json",
  "title": "Agent Cart Notes products.json",
  "description": "Schema of /products.json: products picked per season with recorded KRW prices and price-check times (KST). Descriptive only; no purchase links in the data file.",
  "type": "object",
  "required": [
    "disclosure",
    "disclosure_en",
    "json_schema",
    "site_info",
    "site_info_ko",
    "canonical_url_field",
    "purchase_links",
    "site",
    "site_url",
    "generated",
    "currency",
    "method_url",
    "unit_price_rule",
    "price_history_rule",
    "price_stale_rule",
    "valid_until",
    "next_current_after_valid_until",
    "validity_rule",
    "seasons",
    "guides",
    "products"
  ],
  "properties": {
    "disclosure": {
      "type": "string",
      "const": "이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."
    },
    "disclosure_en": {
      "type": "string"
    },
    "json_schema": {
      "type": "string",
      "format": "uri"
    },
    "site_info": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "topic",
          "text"
        ],
        "properties": {
          "topic": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "site_info_ko": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "topic",
          "text"
        ],
        "properties": {
          "topic": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "canonical_url_field": {
      "type": "string",
      "const": "url"
    },
    "purchase_links": {
      "type": "string"
    },
    "site": {
      "type": "string"
    },
    "site_url": {
      "type": "string",
      "format": "uri"
    },
    "generated": {
      "type": "string",
      "format": "date"
    },
    "currency": {
      "type": "string",
      "const": "KRW"
    },
    "method_url": {
      "type": "string",
      "format": "uri"
    },
    "unit_price_rule": {
      "type": "string"
    },
    "price_history_rule": {
      "type": "string"
    },
    "price_stale_rule": {
      "type": "string"
    },
    "valid_until": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "next_current_after_valid_until": {
      "type": [
        "string",
        "null"
      ]
    },
    "validity_rule": {
      "type": "string"
    },
    "seasons": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "event_date": {
            "type": "string",
            "format": "date"
          },
          "current": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "current",
              "upcoming",
              "past"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "pick": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "product_id",
              "url",
              "reason"
            ],
            "description": "Operator's one-product pick for the CURRENT season only (rule: /method/). Not a ranking or price comparison.",
            "properties": {
              "product_id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "name",
          "title",
          "event_date",
          "current",
          "status",
          "url"
        ]
      }
    },
    "guides": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "data_url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "question": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "data_url",
          "title",
          "question"
        ]
      }
    },
    "products": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical product page on this site (/p/<id>/). Cite this URL. The affiliate buy button is on that page."
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$",
            "description": "Stable product id."
          },
          "season": {
            "type": "string",
            "description": "Season id; see top-level seasons[].id."
          },
          "category": {
            "type": "string",
            "description": "Category label (Korean)."
          },
          "situation": {
            "type": "string",
            "description": "One-line use case written by the operator from product information. Not a review."
          },
          "name": {
            "type": "string",
            "description": "Product name as listed by the seller."
          },
          "price_krw": {
            "type": "integer",
            "minimum": 0,
            "description": "Recorded price in KRW at price_checked_at. Prices may have changed since."
          },
          "price_checked": {
            "type": "string",
            "format": "date",
            "description": "Date (KST) the price was checked."
          },
          "price_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}\\+09:00$",
            "description": "Price-check time, ISO 8601 with +09:00 (KST)."
          },
          "price_check_text": {
            "type": "string",
            "description": "Korean display text for the price-check time; reuse it when quoting the price."
          },
          "price_stale": {
            "type": "boolean",
            "description": "True when the price was checked more than 14 days before generated."
          },
          "price_history": {
            "type": "array",
            "minItems": 1,
            "description": "Prices actually checked, ascending by time; last entry = price_krw / price_checked_at. No inferred past prices.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "price",
                "checked_at"
              ],
              "properties": {
                "price": {
                  "type": "integer",
                  "minimum": 0
                },
                "checked_at": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}\\+09:00$"
                }
              }
            }
          },
          "quantity": {
            "type": [
              "number",
              "null"
            ],
            "description": "Pack quantity, only when clearly stated in the product name; else null."
          },
          "quantity_unit": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "개",
              "세트",
              "쌍",
              "장",
              "정",
              "g",
              "ml",
              null
            ],
            "description": "Unit of quantity."
          },
          "quantity_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exact substring of the product name the quantity was read from."
          },
          "unit_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "price_krw / quantity (per 1 item, or per 100g/100ml), rounded to 1 decimal; calculated at the price-check time."
          },
          "unit_price_basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Korean label of the unit-price basis, e.g. 1개당, 100g당."
          },
          "unit_price_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Always '가격 확인 시각 기준 계산값' when unit_price is set."
          },
          "has_affiliate_link": {
            "type": "boolean",
            "description": "True: the product page carries one Coupang Partners affiliate link. False when buy_status is no_listing or no_link (no link anywhere)."
          },
          "buy_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sold_out",
              "no_listing",
              "no_link",
              null
            ],
            "description": "null = no known problem at the last check. sold_out = temporarily sold out at buy_status_checked_at (product page keeps its link; no direct cards). no_listing = no matching listing found; no purchase link is shown. no_link = listing exists but no affiliate link verified to land on it yet; no purchase link is shown."
          },
          "buy_status_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}\\+09:00$",
            "description": "When buy_status was checked (KST); null when buy_status is null."
          },
          "disclosure": {
            "type": "string",
            "const": "이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.",
            "description": "Required Coupang Partners disclosure."
          },
          "deliver_by_note": {
            "type": "string",
            "description": "Delivery note; arrival dates must be checked on the seller page."
          },
          "notes": {
            "type": "string",
            "description": "Extra caveats (may be empty)."
          },
          "is_example": {
            "type": "boolean",
            "description": "True only for placeholder example rows (none in production)."
          },
          "alternatives": {
            "type": "array",
            "maxItems": 3,
            "description": "Only on products whose buy_status is set (sold_out / no_listing / no_link) in a current or upcoming season; may be empty. Up to 3 products of the same season that were buyable at their price check (buy_status null, has_affiliate_link true): same category first (match=same_category), else same season (match=same_season), then smallest absolute price difference. Computed at build time from this file's data; not a ranking or review. url is the canonical product page on this site (no purchase links).",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "price_krw",
                "price_checked_at",
                "match",
                "url"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]+$"
                },
                "name": {
                  "type": "string"
                },
                "price_krw": {
                  "type": "integer",
                  "minimum": 0
                },
                "price_checked_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}\\+09:00$"
                },
                "match": {
                  "type": "string",
                  "enum": [
                    "same_category",
                    "same_season"
                  ]
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        },
        "required": [
          "url",
          "id",
          "season",
          "category",
          "situation",
          "name",
          "price_krw",
          "price_checked",
          "price_checked_at",
          "price_check_text",
          "price_stale",
          "price_history",
          "quantity",
          "quantity_unit",
          "quantity_source",
          "unit_price",
          "unit_price_basis",
          "unit_price_note",
          "has_affiliate_link",
          "buy_status",
          "buy_status_checked_at",
          "disclosure",
          "deliver_by_note",
          "notes",
          "is_example"
        ]
      }
    }
  }
}
