{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/magicmarkets-com/json-schema/magicmarkets-com-betslip-create-request-schema.json",
  "title": "BetslipCreateRequest",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/magicmarkets-com-openapi.yaml#/components/schemas/BetslipCreateRequest",
  "type": "object",
  "properties": {
    "sport": {
      "type": "string",
      "description": "Sport code (required for normal/lay) - see \"Sports & bet types\" in the introduction."
    },
    "event_id": {
      "type": "string",
      "description": "Event ID (required for normal/lay)"
    },
    "bet_type": {
      "type": "string",
      "description": "Bet type string (required for normal/lay) - see \"Sports & bet types\" in the introduction."
    },
    "live_score": {
      "oneOf": [
        {
          "$ref": "#/$defs/LiveScore"
        },
        {
          "type": "null"
        }
      ],
      "description": "The in-running score you are selecting against, e.g. `{\"home\": 1, \"away\": 0}`. Liquidity a source is quoting at a different in-running score is then never treated as equivalent to your selection, so a line that has already moved on a goal cannot be matched against it. The score stays on the betslip and applies again when an order placed on it re-selects liquidity. Omit it (or send null) for pre-match selections and to accept quotes at whatever score a source is on."
    },
    "legs": {
      "type": "array",
      "description": "Parlay legs (required for parlay, 2-10 legs)",
      "minItems": 2,
      "maxItems": 10,
      "items": {
        "type": "object",
        "required": [
          "sport",
          "event_id",
          "bet_type"
        ],
        "properties": {
          "sport": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "bet_type": {
            "type": "string"
          },
          "live_score": {
            "oneOf": [
              {
                "$ref": "#/$defs/LiveScore"
              },
              {
                "type": "null"
              }
            ],
            "description": "In-running score this leg is selected against, or null"
          }
        }
      }
    },
    "betslip_type": {
      "type": "string",
      "enum": [
        "normal",
        "lay",
        "parlay"
      ],
      "default": "normal"
    },
    "equivalent_bets": {
      "type": "boolean",
      "default": true
    },
    "user_data": {
      "type": "string",
      "maxLength": 512
    },
    "exclude_danger": {
      "type": "boolean",
      "default": false,
      "description": "When true, only liquidity sources that do not hold bets in danger status are used. When false or omitted, all available liquidity sources are used."
    }
  },
  "oneOf": [
    {
      "title": "Single bet",
      "required": [
        "sport",
        "event_id",
        "bet_type"
      ]
    },
    {
      "title": "Parlay",
      "required": [
        "legs",
        "betslip_type"
      ],
      "properties": {
        "betslip_type": {
          "const": "parlay"
        }
      }
    }
  ],
  "$defs": {
    "LiveScore": {
      "type": "object",
      "description": "In-running score at a point in time, `{home, away}`.",
      "required": [
        "home",
        "away"
      ],
      "properties": {
        "home": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1024,
          "description": "Home-team score"
        },
        "away": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1024,
          "description": "Away-team score"
        }
      }
    }
  }
}