{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/odds-api-io/json-schema/odds-api-io-controllers-settlements-response-schema.json",
  "title": "controllers.SettlementsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/odds-api-io-settlement-api-openapi.yml#/components/schemas/controllers.SettlementsResponse",
  "type": "object",
  "properties": {
    "settlements": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/controllers.SettlementResponse"
      }
    },
    "notFound": {
      "type": "array",
      "description": "Event ids we have never seen.",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "controllers.SettlementResponse": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "integer"
        },
        "sport": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "live",
            "awaiting_result",
            "settled",
            "cancelled"
          ]
        },
        "final": {
          "type": "boolean",
          "description": "True when you can stop polling this event."
        },
        "settledAt": {
          "type": "string",
          "format": "date-time",
          "description": "When we recorded the final state. Omitted when unknown."
        },
        "scores": {
          "allOf": [
            {
              "$ref": "#/$defs/dto.Score"
            }
          ],
          "description": "Present only for settled events with a usable score."
        }
      }
    },
    "dto.PeriodScore": {
      "type": "object",
      "properties": {
        "away": {
          "type": "integer"
        },
        "home": {
          "type": "integer"
        },
        "overs": {
          "allOf": [
            {
              "$ref": "#/$defs/dto.SideFloats"
            }
          ],
          "description": "Cricket only. Overs bowled by each side in this innings."
        },
        "wickets": {
          "allOf": [
            {
              "$ref": "#/$defs/dto.SideInts"
            }
          ],
          "description": "Cricket only. Wickets lost by each side in this innings."
        }
      }
    },
    "dto.Score": {
      "type": "object",
      "properties": {
        "away": {
          "type": "integer"
        },
        "home": {
          "description": "Headline result: includes overtime, never a penalty shootout.",
          "type": "integer"
        },
        "periods": {
          "description": "Keyed p1..pN (that period only), ft, ot and ap (running totals after regulation, overtime and a penalty shootout), currentgame, mapN, inningN. See https://docs.odds-api.io/guides/live-events#period-scores",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/dto.PeriodScore"
          }
        }
      }
    },
    "dto.SideFloats": {
      "type": "object",
      "description": "Home/away pair that can be fractional. Cricket overs use cricket notation: 19.3 means nineteen overs and three balls.",
      "properties": {
        "away": {
          "type": "number"
        },
        "home": {
          "type": "number"
        }
      }
    },
    "dto.SideInts": {
      "type": "object",
      "description": "Home/away pair of whole numbers (cricket wickets).",
      "properties": {
        "away": {
          "type": "integer"
        },
        "home": {
          "type": "integer"
        }
      }
    }
  }
}