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

# Đặt lệnh thường

> Đặt lệnh thường trên thị trường cơ sở.



## OpenAPI

````yaml /vi/openapi/tcbs.v1.openapi.yaml post /akhlys/v1/accounts/{accountNo}/orders
openapi: 3.0.3
info:
  title: TCBS iFlash Open API
  description: REST APIs for trading stocks and derivatives on TCBS.
  version: 1.0.0
  contact:
    email: openapi@tcbs.com.vn
servers:
  - url: https://openapi.tcbs.com.vn
    description: Production
security:
  - bearerAuth: []
tags:
  - name: authentication
    description: Xác thực và cấp token truy cập.
    x-group: Xác thực
  - name: account
    description: Thông tin tài khoản, tài sản và hạn mức.
    x-group: Tài khoản
  - name: market-data
    description: Dữ liệu chứng khoán và phái sinh.
    x-group: Dữ liệu thị trường
  - name: cash
    description: Giao dịch và thông tin tiền.
    x-group: Tiền
  - name: stock-orders
    description: Đặt, sửa, hủy và tra cứu lệnh cổ phiếu.
    x-group: Lệnh cổ phiếu
  - name: derivative-orders
    description: Đặt, sửa, hủy và tra cứu lệnh phái sinh.
    x-group: Lệnh phái sinh
paths:
  /akhlys/v1/accounts/{accountNo}/orders:
    post:
      tags:
        - stock-orders
      summary: Đặt lệnh thường
      description: Đặt lệnh thường trên thị trường cơ sở.
      operationId: postAkhlysAccountsAccountNoOrders
      parameters:
        - name: accountNo
          in: path
          required: true
          description: Số tiểu khoản, ví dụ 0001170730.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                execType:
                  allOf:
                    - $ref: '#/components/schemas/StockOrderDirection'
                  description: 'Chiều giao dịch: NS = bán, NB = mua.'
                symbol:
                  type: string
                  description: Mã chứng khoán, ví dụ VNM.
                priceType:
                  allOf:
                    - $ref: '#/components/schemas/StockPriceType'
                  description: 'Loại giá: LO, ATO, ATC, PLO, MP, MTL, MOK, MAK.'
                price:
                  type: integer
                  format: int64
                  description: Giá giao dịch.
                quantity:
                  type: integer
                  format: int64
                  description: Khối lượng giao dịch.
              required:
                - execType
                - symbol
                - priceType
                - price
                - quantity
            example:
              execType: NB
              symbol: VNM
              priceType: LO
              price: 10000
              quantity: 100
      responses:
        '200':
          description: Phản hồi thành công
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Mã lỗi, 0 = thành công.
                  message:
                    type: string
                    description: Thông báo kết quả.
                  orderId:
                    type: string
                    description: Mã lệnh được tạo.
              example:
                error: '0'
                message: Đặt lệnh thành công!
                orderId: '9202205230000324355'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    StockOrderDirection:
      type: string
      description: 'Chiều giao dịch lệnh cơ sở: NS = bán, NB = mua.'
      enum:
        - NS
        - NB
    StockPriceType:
      type: string
      description: 'Loại giá lệnh cơ sở: LO, ATO, ATC, PLO, MP, MTL, MOK hoặc MAK.'
      enum:
        - LO
        - ATO
        - ATC
        - PLO
        - MP
        - MTL
        - MOK
        - MAK
  responses:
    Unauthorized:
      description: Không xác thực — thiếu, sai hoặc không hợp lệ Bearer token.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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