{
  "path": "/futures/{settle}/orders_timerange",
  "operation_id": "getOrdersWithTimeRange",
  "auth_required": true,
  "parameters": [
    {
      "name": "settle",
      "in": "path",
      "description": "Perpetual futures settlement currency",
      "required": true,
      "schema": {
        "type": "string",
        "enum": [
          "btc",
          "usdt",
          "usd1"
        ]
      },
      "example": "usdt"
    },
    {
      "name": "contract",
      "in": "query",
      "description": "Futures contract, return related data only if specified",
      "required": false,
      "schema": {
        "type": "string"
      },
      "example": "BTC_USDT"
    },
    {
      "name": "from",
      "in": "query",
      "description": "Start timestamp\n\nSpecify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int64"
      },
      "example": 1547706332
    },
    {
      "name": "to",
      "in": "query",
      "description": "Termination Timestamp\n\nSpecify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int64"
      },
      "example": 1547706332
    },
    {
      "name": "limit",
      "in": "query",
      "description": "Maximum number of records returned in a single list",
      "required": false,
      "schema": {
        "type": "integer",
        "default": 100,
        "minimum": 1,
        "maximum": 1000
      },
      "example": 100
    },
    {
      "name": "offset",
      "in": "query",
      "description": "List offset, starting from 0",
      "required": false,
      "schema": {
        "type": "integer",
        "default": 0,
        "minimum": 0
      },
      "example": 0
    }
  ],
  "response_fields": {
    "200": {
      "description": "List retrieved successfully",
      "fields": [
        {
          "path": "$",
          "type": "array<object>",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$[]",
          "type": "object",
          "description": "Futures order details",
          "constraints": ""
        },
        {
          "path": "$[].id",
          "type": "integer",
          "description": "Futures order ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$[].user",
          "type": "integer",
          "description": "User ID",
          "constraints": ""
        },
        {
          "path": "$[].create_time",
          "type": "number",
          "description": "Creation time of order",
          "constraints": "格式：\"double\""
        },
        {
          "path": "$[].update_time",
          "type": "string",
          "description": "OrderUpdateTime",
          "constraints": ""
        },
        {
          "path": "$[].finish_time",
          "type": "string",
          "description": "Order finished time. Not returned if order is open",
          "constraints": ""
        },
        {
          "path": "$[].finish_as",
          "type": "string",
          "description": "How the order was finished:\n\n- filled: all filled\n- cancelled: manually cancelled\n- liquidated: cancelled because of liquidation\n- ioc: time in force is `IOC`, finish immediately\n- auto_deleveraged: finished by ADL\n- reduce_only: cancelled because of increasing position while `reduce-only` set\n- position_closed: cancelled because the position was closed\n- reduce_out: only reduce positions by excluding hard-to-fill orders\n- stp: cancelled because self trade prevention",
          "constraints": "枚举：filled / cancelled / liquidated / ioc / auto_deleveraged / reduce_only / position_closed / reduce_out / stp"
        },
        {
          "path": "$[].status",
          "type": "string",
          "description": "Order status\n\n- `open`: Pending\n- `finished`: Completed",
          "constraints": "枚举：open / finished"
        },
        {
          "path": "$[].contract",
          "type": "string",
          "description": "Futures contract",
          "constraints": ""
        },
        {
          "path": "$[].size",
          "type": "string",
          "description": "Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders.",
          "constraints": ""
        },
        {
          "path": "$[].iceberg",
          "type": "string",
          "description": "Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees.",
          "constraints": ""
        },
        {
          "path": "$[].price",
          "type": "string",
          "description": "Required. Order Price; a price of 0 with `tif` as `ioc` represents a market order.",
          "constraints": ""
        },
        {
          "path": "$[].close",
          "type": "boolean",
          "description": "Set as `true` to close the position, with `size` set to 0",
          "constraints": "默认：false"
        },
        {
          "path": "$[].is_close",
          "type": "boolean",
          "description": "Is the order to close position",
          "constraints": ""
        },
        {
          "path": "$[].reduce_only",
          "type": "boolean",
          "description": "Set as `true` to be reduce-only order",
          "constraints": "默认：false"
        },
        {
          "path": "$[].is_reduce_only",
          "type": "boolean",
          "description": "Is the order reduce-only",
          "constraints": ""
        },
        {
          "path": "$[].is_liq",
          "type": "boolean",
          "description": "Is the order for liquidation",
          "constraints": ""
        },
        {
          "path": "$[].tif",
          "type": "string",
          "description": "Time in force\n\n- gtc: GoodTillCancelled\n- ioc: ImmediateOrCancelled, taker only\n- poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee\n- fok: FillOrKill, fill either completely or none",
          "constraints": "默认：\"gtc\"；枚举：gtc / ioc / poc / fok"
        },
        {
          "path": "$[].left",
          "type": "string",
          "description": "Unfilled quantity",
          "constraints": ""
        },
        {
          "path": "$[].fill_price",
          "type": "string",
          "description": "Fill price",
          "constraints": ""
        },
        {
          "path": "$[].text",
          "type": "string",
          "description": "Custom order information. If not empty, must follow the rules below:\n\n1. Prefixed with `t-`\n2. No longer than 28 bytes without `t-` prefix\n3. Can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.)\n\nIn addition to user-defined information, the following are internal reserved fields that identify the order source:\n\n- web: Web\n- api: API call\n- app: Mobile app\n- auto_deleveraging: Automatic deleveraging\n- liquidation: Forced liquidation of positions under the old classic mode\n- liq-xxx: a. Forced liquidation of positions under the new classic mode, including isolated margin, one-way cross margin, and non-hedged positions under two-way cross margin. b. Forced liquidation of isolated positions under the unified account single-currency margin mode\n- hedge-liq-xxx: Forced liquidation of hedged positions under the new classic mode two-way cross margin, i.e., simultaneously closing long and short positions\n- pm_liquidate: Forced liquidation under unified account multi-currency margin mode\n- comb_margin_liquidate: Forced liquidation under unified account portfolio margin mode\n- scm_liquidate: Forced liquidation of positions under unified account single-currency margin mode\n- insurance: Insurance\n- clear: Contract delisting withdrawal",
          "constraints": ""
        },
        {
          "path": "$[].tkfr",
          "type": "string",
          "description": "Taker fee",
          "constraints": ""
        },
        {
          "path": "$[].mkfr",
          "type": "string",
          "description": "Maker fee",
          "constraints": ""
        },
        {
          "path": "$[].refu",
          "type": "integer",
          "description": "Referrer user ID",
          "constraints": ""
        },
        {
          "path": "$[].auto_size",
          "type": "string",
          "description": "Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0",
          "constraints": "枚举：close_long / close_short"
        },
        {
          "path": "$[].stp_id",
          "type": "integer",
          "description": "Orders between users in the same `stp_id` group are not allowed to be self-traded\n\n1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker.\n2. `stp_id` returns `0` by default for orders that have not been set for `STP group`",
          "constraints": ""
        },
        {
          "path": "$[].stp_act",
          "type": "string",
          "description": "Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies\n\n1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy.\n2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter.\n3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-'\n\n- cn: Cancel newest, cancel new orders and keep old ones\n- co: Cancel oldest, cancel old orders and keep new ones\n- cb: Cancel both, both old and new orders will be cancelled",
          "constraints": "枚举：co / cn / cb / -"
        },
        {
          "path": "$[].amend_text",
          "type": "string",
          "description": "The custom data that the user remarked when amending the order",
          "constraints": ""
        },
        {
          "path": "$[].pid",
          "type": "integer",
          "description": "Position ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$[].market_order_slip_ratio",
          "type": "string",
          "description": "Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used",
          "constraints": ""
        },
        {
          "path": "$[].pos_margin_mode",
          "type": "string",
          "description": "Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode",
          "constraints": ""
        },
        {
          "path": "$[].tpsl_tp_trigger_price",
          "type": "string",
          "description": "Take profit price",
          "constraints": ""
        },
        {
          "path": "$[].tpsl_sl_trigger_price",
          "type": "string",
          "description": "Stop loss price",
          "constraints": ""
        }
      ]
    }
  },
  "source_version": "v4.106.132",
  "source_url": "https://github.com/gate/gateapi-python/blob/cd2cac4d339ec0734480787d23c020f467fd7b80/openapi.yaml",
  "local_tool_limits": [
    "仅检查必填、枚举和简单数值范围",
    "复杂类型序列化、条件必填、时间窗口等以官方规则为准",
    "不会发起 API 请求"
  ]
}
