{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shelfatlas-com/json-schema/shelfatlas-com-steering-event-request-schema.json",
  "title": "SteeringEventRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shelfatlas-com-observations-api-openapi.yml#/components/schemas/SteeringEventRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "product_id",
    "winning_store_id",
    "involved"
  ],
  "properties": {
    "product_id": {
      "type": "string",
      "format": "uuid"
    },
    "winning_store_id": {
      "type": "string",
      "format": "uuid",
      "description": "The store the \"best choice\" card actually pointed to."
    },
    "visitor_key": {
      "type": "string",
      "format": "uuid",
      "description": "Opaque per-device key the consumer surface generates and keeps locally, used only for the report's COUNT(DISTINCT visitor). Omit to skip unique-visitor counting for this render."
    },
    "involved": {
      "type": "array",
      "minItems": 1,
      "maxItems": 25,
      "description": "One entry per candidate chain compared for this render.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "nearest_store_id",
          "distance_band",
          "price_gap_cents"
        ],
        "properties": {
          "nearest_store_id": {
            "type": "string",
            "format": "uuid",
            "description": "The candidate chain's store nearest the visitor."
          },
          "distance_band": {
            "type": "string",
            "enum": [
              "<1",
              "1-3",
              "3-10",
              ">10"
            ],
            "description": "Client-computed distance bucket, kilometres — never a raw coordinate."
          },
          "price_gap_cents": {
            "type": "integer",
            "description": "This candidate's price minus the winning store's, in cents."
          }
        }
      }
    }
  }
}