> ## Documentation Index
> Fetch the complete documentation index at: https://hoalulab.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Lấy thông tin lệnh điều kiện

> Lấy danh sách lệnh điều kiện (Smart Order).



## OpenAPI

````yaml /vi/openapi/entrade-v1.yaml get /orders
openapi: 3.1.0
info:
  title: Entrade Open API
  version: 1.0.0
  description: Đặc tả được trích xuất từ các request Bruno trong `collections/Entrade`.
servers:
  - url: https://services.entrade.com.vn/entrade-api
    description: Môi trường production
  - url: https://services-staging.entrade.com.vn/papertrade-entrade-api
    description: Môi trường staging
security:
  - BearerAuth: []
tags:
  - name: authentication
    description: API đăng nhập và cấp JWT token.
    x-group: Xác thực
  - name: account
    description: Thông tin tài khoản, tài sản và cấu hình rủi ro.
    x-group: Tài khoản
  - name: derivatives
    description: Giao dịch, sức mua, gói vay và vị thế phái sinh.
    x-group: Phái sinh
  - name: smart-order
    description: Lệnh điều kiện trên dịch vụ Smart Order.
    x-group: Smart Order
paths:
  /orders:
    get:
      tags:
        - smart-order
      summary: Lấy thông tin lệnh điều kiện
      description: Lấy danh sách lệnh điều kiện (Smart Order).
      operationId: listSmartOrders
      parameters:
        - name: investorId
          in: query
          description: Mã khách hàng
          schema:
            type: number
        - name: _start
          in: query
          description: Index bắt đầu duyệt, nên để là 0
          schema:
            type: number
        - name: _end
          in: query
          description: Index kết thúc duyệt
          schema:
            type: number
      responses:
        '200':
          description: Thành công – trả về danh sách lệnh điều kiện
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmartOrderPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalError'
      servers:
        - url: https://services-staging.entrade.com.vn/papertrade-smart-order
          description: Môi trường staging Smart Order
components:
  schemas:
    SmartOrderPage:
      type: object
      properties:
        total:
          type: number
          description: Tổng số các lệnh điều kiện
        data:
          type: array
          description: Danh sách các lệnh điều kiện
          items:
            $ref: '#/components/schemas/SmartOrder'
    SmartOrder:
      type: object
      properties:
        id:
          type: string
          description: Số hiệu lệnh
        status:
          type: string
          description: “PendingTrigger”, “Canceled” hoặc “Triggered”
        investorId:
          type: string
          description: Mã khách hàng
        investorAccountId:
          type: number
          description: Mã tài khoản
        bankMarginPortfolioId:
          type: number
          description: Mã gói vay
        symbol:
          type: string
          description: Mã phái sinh (ví dụ "VN30F2504")
        condition:
          type: string
          description: Điều kiện đặt lệnh (ví dụ ">= 1369", "<= 1396")
        targetPrice:
          type: number
          description: Giá đặt
        targetSide:
          type: string
          description: '"NB" (Mua) hoặc "NS" (Bán)'
        targetQuantity:
          type: number
          description: Khối lượng đặt
        type:
          type: string
          description: Chỉ nhận giá trị "STOP"
        expiredTime:
          type: string
          description: Thời gian đóng lệnh
        createdDate:
          type: string
          description: >-
            Thời điểm (ngày giờ) đặt lệnh, theo định dạng ISO UTC 8601 format
            datetime. Ví dụ: 2022-07-15T10:00:00.111+07:00
        modifiedDate:
          type: string
          description: Thời điểm (ngày giờ) thay đổi cuối cùng của lệnh
        metadata:
          type: object
          properties: {}
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        status:
          type: number
  responses:
    BadRequest:
      description: Yêu cầu không hợp lệ
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Lỗi máy chủ
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token lấy từ API đăng nhập.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.