{
  "path": "/futures/{settle}/price_orders/{order_id}",
  "operation_id": "getPriceTriggeredOrder",
  "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": "order_id",
      "in": "path",
      "required": true,
      "description": "ID returned when order is successfully created",
      "schema": {
        "type": "integer",
        "format": "int64"
      }
    }
  ],
  "response_fields": {
    "200": {
      "description": "Auto order details",
      "fields": [
        {
          "path": "$",
          "type": "object",
          "description": "Futures price-triggered order details",
          "constraints": ""
        },
        {
          "path": "$.initial",
          "type": "object",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$.initial.contract",
          "type": "string",
          "description": "Futures contract",
          "constraints": ""
        },
        {
          "path": "$.initial.size",
          "type": "integer",
          "description": "Represents the number of contracts that need to be closed, full closing: size=0\nPartial closing: plan-close-short-position size>0 \nPartial closing: plan-close-long-position size<0",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.initial.amount",
          "type": "string",
          "description": "Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence.",
          "constraints": ""
        },
        {
          "path": "$.initial.price",
          "type": "string",
          "description": "Order price. Set to 0 to use market price",
          "constraints": ""
        },
        {
          "path": "$.initial.close",
          "type": "boolean",
          "description": "When fully closing a position in single-position mode, close must be set to true to execute the close operation.\nWhen partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false.",
          "constraints": "默认：false"
        },
        {
          "path": "$.initial.tif",
          "type": "string",
          "description": "Time in force strategy, default is gtc, market orders currently only support ioc mode\n\n- gtc: GoodTillCancelled\n- ioc: ImmediateOrCancelled",
          "constraints": "默认：\"gtc\"；枚举：gtc / ioc"
        },
        {
          "path": "$.initial.text",
          "type": "string",
          "description": "The source of the order, including:\n- web: Web\n- api: API call\n- app: Mobile app",
          "constraints": ""
        },
        {
          "path": "$.initial.reduce_only",
          "type": "boolean",
          "description": "When set to true, perform automatic position reduction operation. Set to true to ensure that the order will not open a new position, and is only used to close or reduce positions",
          "constraints": "默认：false"
        },
        {
          "path": "$.initial.auto_size",
          "type": "string",
          "description": "One-way Mode: auto_size is not required\nHedge Mode full closing (size=0): auto_size must be set, close_long for closing long positions, close_short for closing short positions\nHedge Mode partial closing (size≠0): auto_size is not required",
          "constraints": ""
        },
        {
          "path": "$.initial.is_reduce_only",
          "type": "boolean",
          "description": "Is the order reduce-only",
          "constraints": ""
        },
        {
          "path": "$.initial.is_close",
          "type": "boolean",
          "description": "Is the order to close position",
          "constraints": ""
        },
        {
          "path": "$.trigger",
          "type": "object",
          "description": "",
          "constraints": ""
        },
        {
          "path": "$.trigger.strategy_type",
          "type": "integer",
          "description": "Trigger Strategy\n\n - 0: Price trigger, triggered when price meets conditions\n - 1: Price spread trigger, i.e. the difference between the latest price specified in `price_type` and the second-last price\nCurrently only supports 0 (latest transaction price)",
          "constraints": "格式：\"int32\"；枚举：0 / 1"
        },
        {
          "path": "$.trigger.price_type",
          "type": "integer",
          "description": "Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price",
          "constraints": "格式：\"int32\"；枚举：0 / 1 / 2"
        },
        {
          "path": "$.trigger.price",
          "type": "string",
          "description": "Price value for price trigger, or spread value for spread trigger",
          "constraints": ""
        },
        {
          "path": "$.trigger.rule",
          "type": "integer",
          "description": "Price Condition Type\n\n- 1: Trigger when the price calculated based on `strategy_type` and `price_type` is greater than or equal to `Trigger.Price`, while Trigger.Price must > last_price\n- 2: Trigger when the price calculated based on `strategy_type` and `price_type` is less than or equal to `Trigger.Price`, and Trigger.Price must < last_price",
          "constraints": "格式：\"int32\"；枚举：1 / 2"
        },
        {
          "path": "$.trigger.expiration",
          "type": "integer",
          "description": "Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout",
          "constraints": ""
        },
        {
          "path": "$.id",
          "type": "integer",
          "description": "Auto order ID",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.id_string",
          "type": "string",
          "description": "String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments.\nPrefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes.",
          "constraints": ""
        },
        {
          "path": "$.user",
          "type": "integer",
          "description": "User ID",
          "constraints": ""
        },
        {
          "path": "$.create_time",
          "type": "number",
          "description": "Created time",
          "constraints": "格式：\"double\""
        },
        {
          "path": "$.finish_time",
          "type": "number",
          "description": "End time",
          "constraints": "格式：\"double\""
        },
        {
          "path": "$.trade_id",
          "type": "integer",
          "description": "ID of the order created after trigger",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.status",
          "type": "string",
          "description": "Order status\n\n- `open`: Active\n- `finished`: Finished\n- `inactive`: Inactive, only applies to order take-profit/stop-loss\n- `invalid`: Invalid, only applies to order take-profit/stop-loss",
          "constraints": "枚举：open / finished / inactive / invalid"
        },
        {
          "path": "$.finish_as",
          "type": "string",
          "description": "Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired",
          "constraints": "枚举：cancelled / succeeded / failed / expired"
        },
        {
          "path": "$.reason",
          "type": "string",
          "description": "Additional description of how the order was completed",
          "constraints": ""
        },
        {
          "path": "$.order_type",
          "type": "string",
          "description": "Types of take-profit and stop-loss orders, including:\n\n- `close-long-order`: Order take-profit/stop-loss, close long position\n- `close-short-order`: Order take-profit/stop-loss, close short position\n- `close-long-position`: Position take-profit/stop-loss, used to close all long positions\n- `close-short-position`: Position take-profit/stop-loss, used to close all short positions\n- `plan-close-long-position`: Position plan take-profit/stop-loss, used to close all or partial long positions\n- `plan-close-short-position`: Position plan take-profit/stop-loss, used to close all or partial short positions\n\nThe two types of order take-profit/stop-loss are read-only and cannot be passed in requests",
          "constraints": ""
        },
        {
          "path": "$.me_order_id",
          "type": "integer",
          "description": "Corresponding order ID for order take-profit/stop-loss orders",
          "constraints": "格式：\"int64\""
        },
        {
          "path": "$.pos_margin_mode",
          "type": "string",
          "description": "Position margin mode: `isolated` (isolated margin) or `cross` (cross margin).\nReturned by the server in simple split-position mode; when writing, use only the values below.",
          "constraints": "枚举：isolated / cross"
        }
      ]
    }
  },
  "source_version": "v4.106.132",
  "source_url": "https://github.com/gate/gateapi-python/blob/cd2cac4d339ec0734480787d23c020f467fd7b80/openapi.yaml",
  "local_tool_limits": [
    "仅检查必填、枚举和简单数值范围",
    "复杂类型序列化、条件必填、时间窗口等以官方规则为准",
    "不会发起 API 请求"
  ]
}
