{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/magicmarkets-com/json-schema/magicmarkets-com-order-create-request-schema.json",
  "title": "OrderCreateRequest",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/magicmarkets-com-openapi.yaml#/components/schemas/OrderCreateRequest",
  "type": "object",
  "required": [
    "betslip_id",
    "price",
    "stake"
  ],
  "properties": {
    "betslip_id": {
      "type": "string",
      "maxLength": 64
    },
    "price": {
      "type": "number",
      "minimum": 1.0,
      "maximum": 50000,
      "description": "Limit decimal price. A bet is taken only at this price or better, and an off-tick limit moves to the first tick that honours it; see \"Price ticks\"."
    },
    "stake": {
      "$ref": "#/$defs/StakeTuple"
    },
    "duration": {
      "type": "number",
      "minimum": 0.05,
      "maximum": 259200,
      "description": "Order duration in seconds (default 15, at most 72 hours)"
    },
    "exchange_mode": {
      "type": "string",
      "enum": [
        "make_and_take",
        "take_only",
        "dark"
      ],
      "default": "make_and_take",
      "description": "How the order interacts with the exchange. `make_and_take`: fill against the best available liquidity first; any remaining stake is advertised on the exchange at your price, while the order keeps taking newly available liquidity. `take_only`: only consume available liquidity; remaining stake is never advertised and other orders cannot match against it. `dark`: like `make_and_take`, but the advertised remaining stake is hidden from other customers - they can still match it when their price crosses yours, but they cannot see your price until then. There is no post-only mode: no order type rests in the book without also taking crossing liquidity."
    },
    "keep_open_ir": {
      "type": "boolean",
      "default": false,
      "description": "Keep order open when event goes in-play"
    },
    "user_data": {
      "type": "string",
      "maxLength": 512
    },
    "request_uuid": {
      "type": "string",
      "format": "uuid",
      "description": "Idempotency key"
    },
    "accept_partial_fill": {
      "type": "boolean",
      "default": true
    },
    "accept_better_price": {
      "type": "boolean",
      "default": true
    },
    "force_want_price": {
      "type": "boolean",
      "default": false
    },
    "min_taker_want_stake": {
      "oneOf": [
        {
          "$ref": "#/$defs/StakeTuple"
        }
      ],
      "description": "`dark` orders only (rejected on other modes): the minimum total stake another order must request to be allowed to match yours at your price point. Cannot exceed the order's own stake. Set it non-zero to stop small probe orders from discovering your price."
    },
    "current_score": {
      "oneOf": [
        {
          "type": "array",
          "prefixItems": [
            {
              "type": "integer",
              "description": "Home score"
            },
            {
              "type": "integer",
              "description": "Away score"
            }
          ],
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 32767
          },
          "minItems": 2,
          "maxItems": 2
        }
      ],
      "description": "Placement-time score assertion, `[home, away]`. When present, the order is rejected with `validation_error` / `non_field_errors: [\"event_scores_dont_match\"]` unless the value matches the live score the exchange holds for the event - use it to avoid placing on a price that has not reacted to a goal yet. Only meaningful for football: for sports without a goal-style running score, and while no score is known yet, the server assumes `[0, 0]` and rejects any other value. Omit the field to skip the check."
    },
    "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."
    },
    "min_stake": {
      "oneOf": [
        {
          "$ref": "#/$defs/StakeTuple"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional minimum stake of each fill. A remaining stake smaller than this value is not filled."
    },
    "placer_type": {
      "type": "string",
      "maxLength": 32,
      "description": "Optional caller-supplied tag recorded against the order."
    }
  },
  "$defs": {
    "StakeTuple": {
      "type": "array",
      "description": "[currency, amount] - e.g. [\"USDT\", 115.38]",
      "prefixItems": [
        {
          "type": "string",
          "description": "Currency code (always USDT in responses)"
        },
        {
          "type": "number",
          "description": "Amount"
        }
      ],
      "items": {
        "type": [
          "string",
          "number"
        ]
      },
      "minItems": 2,
      "maxItems": 2
    }
  }
}