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

# Vị thế nắm giữ

> Lấy danh sách các vị thế đang nắm giữ trên tài khoản, bao gồm thông tin mã chứng khoán, khối lượng, giá vốn, và các thông tin khác.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-07-23.yaml get /accounts/{accountNo}/positions
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:
  /accounts/{accountNo}/positions:
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
    get:
      tags:
        - account
      summary: Vị thế nắm giữ
      description: >-
        Lấy danh sách các vị thế đang nắm giữ trên tài khoản, bao gồm thông tin
        mã chứng khoán, khối lượng, giá vốn, và các thông tin khác.
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Danh sách vị thế cơ sở
            - DERIVATIVE: Danh sách vị thế phái sinh
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: pageSize
          in: query
          description: Kích thước trang dữ liệu (page size)
          deprecated: false
          schema:
            type: string
          example: '20'
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          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
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 654
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:39:12 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  positions:
                    type: array
                    example:
                      - id: 177410795472387
                        symbol: 41I1G4000
                        accountNo: '0001179019'
                        status: OPEN
                        loanPackageId: 2278
                        side: NB
                        accumulateQuantity: 6
                        tradeQuantity: 1
                        closedQuantity: 5
                        openQuantity: 1
                        overNightQuantity: 0
                        costPrice: 1834.5
                        marketPrice: 1706.1
                        breakEvenPrice: 1834.95691
                        createdDate: '2026-03-23T03:08:32.773651Z'
                        modifiedDate: '2026-03-23T04:07:45.692156Z'
                    description: ''
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 177410795472387
                          description: ID vị thế
                          format: int64
                        symbol:
                          type: string
                          example: 41I1G4000
                          description: Mã chứng khoán
                        marketType:
                          type: string
                          example: DERIVATIVE
                          description: |-
                            Loại thị trường
                            - STOCK: Gói vay giao dịch cơ sở
                            - DERIVATIVE: Gói vay giao dịch phái sinh
                        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
                          example: 2278
                          description: Gói vay cơ sở hoặc phái sinh
                          format: int32
                        side:
                          type: string
                          example: NB
                          description: |-
                            Loại vị thế
                            - NB: Mua
                            - NS: Bán
                        accumulateQuantity:
                          type: integer
                          example: 6
                          description: Khối lượng cộng dồn
                          format: int32
                        tradeQuantity:
                          type: integer
                          example: 1
                          description: Khối lượng được giao dịch
                          format: int32
                        closedQuantity:
                          type: integer
                          example: 5
                          description: Khối lượng đã đóng
                          format: int32
                        openQuantity:
                          type: integer
                          example: 1
                          description: Khối lượng mở
                          format: int32
                        overNightQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng mở qua đêm (dành cho phái sinh)
                          format: int32
                        costPrice:
                          type: number
                          example: 1834.5
                          description: Giá vốn trung bình của khối lượng mở
                          format: float
                        marketPrice:
                          type: number
                          example: 1706.1
                          description: Giá thị trường
                          format: double
                        breakEvenPrice:
                          type: number
                          example: 1834.95691
                          description: Giá hòa vốn
                          format: double
                        createdDate:
                          type: string
                          example: '2026-03-23T03:08:32.773651Z'
                          description: Thời điểm mở
                          format: date-time
                        modifiedDate:
                          type: string
                          example: '2026-03-23T04:07:45.692156Z'
                          description: Thời điểm cập nhật
                          format: date-time
                  pageIndex:
                    type: integer
                    example: 0
                    description: Kích thước trang dữ liệu (dành cho phái sinh)
                    format: int32
                  pageSize:
                    type: integer
                    example: 20
                    description: Số bản ghi trên 1 trang (dành cho phái sinh)
                    format: int32
                  pageNumber:
                    type: integer
                    example: 1
                    description: Số trang (chỉ dành cho phái sinh)
                    format: int32
                  total:
                    type: integer
                    example: 1
                    description: Tổng số vị thế (chỉ dành cho phái sinh)
                    format: int32
              example:
                positions:
                  - id: 177410795472387
                    symbol: 41I1G4000
                    accountNo: '0001179019'
                    marketType: DERIVATIVE
                    status: OPEN
                    loanPackageId: 2278
                    side: NB
                    accumulateQuantity: 6
                    tradeQuantity: 1
                    closedQuantity: 5
                    openQuantity: 1
                    overNightQuantity: 0
                    costPrice: 1834.5
                    marketPrice: 1706.1
                    breakEvenPrice: 1834.95691
                    createdDate: '2026-03-23T03:08:32.773651Z'
                    modifiedDate: '2026-03-23T04:07:45.692156Z'
                pageIndex: 0
                pageSize: 20
                pageNumber: 1
                total: 1
        '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:
                  code:
                    type: string
                  message:
                    type: string
                  status:
                    type: integer
              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.