> ## 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.

# Chi tiết vị thế theo ID

> Lấy thông tin chi tiết của một vị thế cơ sở hoặc phái sinh đang mở theo `positionId.`



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-07-23.yaml get /positions/{positionId}
openapi: 3.0.0
info:
  title: OpenAPI-V2-Spec 260730
  version: 1.0.0
  description: DNSE OpenAPI spec and tests
servers:
  - url: https://openapi-uat.dnse.com.vn
security: []
paths:
  /positions/{positionId}:
    parameters:
      - name: positionId
        in: path
        required: true
        description: Id vị thế
        schema:
          type: integer
        example: 178488852178882
    get:
      tags:
        - account
      summary: Chi tiết vị thế theo ID
      description: "Lấy thông tin chi tiết của một vị thế cơ sở hoặc phái sinh đang mở theo\_`positionId.`"
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Vị thế cơ sở
            - DERIVATIVE: Vị thế phái sinh
          schema:
            type: string
          example: DERIVATIVE
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              deprecated: false
              schema: {}
              example: '456'
            Vary:
              deprecated: false
              schema: {}
              example: Origin
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
              example: '-1'
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
              example: '0'
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
              example: '1784795976'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Date:
              deprecated: false
              schema: {}
              example: Fri, 31 Jul 2026 10:53:55 GMT
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    format: int32
                    example: 9589
                    description: ID vị thế
                  symbol:
                    type: string
                    example: BVS
                    description: Mã chứng khoán
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  status:
                    type: string
                    example: OPEN
                    description: |-
                      Trạng thái của vị thế
                      - OPEN: Đang mở
                      - PENDING_CLOSE: Chờ đóng
                      - CLOSED: Đã đóng
                      - ODD_LOT: Lô lẻ (cơ sở)
                  loanPackageId:
                    type: integer
                    format: int32
                    example: 5757
                    description: Gói vay cơ sở hoặc phái sinh
                  side:
                    type: string
                    example: NB
                    description: |-
                      Loại vị thế
                      - NB: Mua
                      - NS: Bán
                  accumulateQuantity:
                    type: integer
                    format: int32
                    example: 3400
                    description: Khối lượng cộng dồn
                  tradeQuantity:
                    type: integer
                    format: int32
                    example: 3400
                    description: Khối lượng được giao dịch
                  closedQuantity:
                    type: integer
                    format: int32
                    example: 0
                    description: Khối lượng đã đóng
                  openQuantity:
                    type: integer
                    format: int32
                    example: 3400
                    description: Khối lượng mở
                  costPrice:
                    type: integer
                    format: int32
                    example: 28000
                    description: Giá vốn trung bình của khối lượng mở
                  averageCostPrice:
                    type: integer
                    format: int32
                    example: 28000
                    description: Giá vốn trung bình
                  averageClosePrice:
                    type: integer
                    format: int32
                    example: 0
                    description: Giá đóng trung bình
                  marketPrice:
                    type: integer
                    format: int32
                    example: 25200
                    description: Giá thị trường
                  breakEvenPrice:
                    type: number
                    format: double
                    example: 28043.4752
                    description: Giá hòa vốn
                  createdDate:
                    type: string
                    format: date-time
                    example: '2026-07-20T04:22:38.904283Z'
                    description: Thời điểm mở
                  modifiedDate:
                    type: string
                    format: date-time
                    example: '2026-07-30T11:20:44.65933Z'
                    description: Thời điểm cập nhật
              examples:
                STOCK:
                  value:
                    id: 9589
                    symbol: BVS
                    accountNo: '0001179019'
                    status: OPEN
                    loanPackageId: 5757
                    side: NB
                    accumulateQuantity: 3400
                    tradeQuantity: 3400
                    closedQuantity: 0
                    openQuantity: 3400
                    costPrice: 28000
                    averageCostPrice: 28000
                    averageClosePrice: 0
                    marketPrice: 25200
                    breakEvenPrice: 28043.4752
                    createdDate: '2026-07-20T04:22:38.904283Z'
                    modifiedDate: '2026-07-30T11:20:44.65933Z'
                DERIVATIVE:
                  value:
                    id: 178488852178882
                    symbol: 41I1G9000
                    marketType: DERIVATIVE
                    accountNo: '0001179019'
                    status: OPEN
                    loanPackageId: 2279
                    side: NS
                    accumulateQuantity: 12
                    tradeQuantity: 10
                    closedQuantity: 2
                    openQuantity: 10
                    overNightQuantity: 10
                    costPrice: 1855.4
                    averageCostPrice: 1855.4
                    averageClosePrice: 1931
                    marketPrice: 1931.5
                    breakEvenPrice: 1854.93962
                    createdDate: '2026-07-30T07:27:30.375891Z'
                    modifiedDate: '2026-07-30T15:41:24.838062Z'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500

````

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