{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iwant.fyi/.well-known/iwantfyi/schemas/1.1/match.json",
  "title": "Match",
  "description": "A piece of supply matched to a Want (iwant.fyi demand-side protocol v1.1 §6.2).",
  "type": "object",
  "required": ["id", "source", "source_id", "title", "price_cents", "url", "score"],
  "properties": {
    "id": { "type": "string" },
    "source": { "type": "string" },
    "source_id": { "type": "string" },
    "title": { "type": "string" },
    "description": { "type": ["string", "null"] },
    "price_cents": { "type": "integer" },
    "price_currency": { "type": "string" },
    "shipping_cents": { "type": "integer" },
    "total_price_cents": { "type": "integer" },
    "condition": { "type": ["string", "null"], "enum": ["new", "like-new", "good", "fair", "used", "unknown", null] },
    "mode": { "type": "string", "enum": ["new", "used"] },
    "location": { "type": ["string", "null"] },
    "images": { "type": "array", "items": { "type": "string" } },
    "url": { "type": "string", "description": "Link the agent should surface; MAY carry affiliate tracking (do not strip)." },
    "direct_url": { "type": "string" },
    "score": { "type": "number", "minimum": 0, "maximum": 1 },
    "reasons": { "type": "array", "items": { "type": "string" } },
    "attributes": { "type": "object" },
    "supply_metadata": {
      "type": "object",
      "description": "Well-known provenance/freshness keys (v1.1 §6.2); all optional.",
      "properties": {
        "retrieved_at": { "type": "string", "format": "date-time" },
        "freshness_ttl_s": { "type": "integer" },
        "in_stock": { "enum": [true, false, "unknown"] },
        "enriched": { "type": "boolean" },
        "seller_trust": { "type": "number", "minimum": 0, "maximum": 1 }
      }
    }
  }
}
