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

# Tra cứu nợ

> Lấy thông tin dư nợ margin (lịch sử khoản vay) của tiểu khoản.



## OpenAPI

````yaml /vi/openapi/tcbs.v1.openapi.yaml get /erebos/v2/digital/margin-info
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:
  /erebos/v2/digital/margin-info:
    get:
      tags:
        - cash
      summary: Tra cứu nợ
      description: Lấy thông tin dư nợ margin (lịch sử khoản vay) của tiểu khoản.
      operationId: getErebosDigitalMarginInfo
      parameters:
        - name: acctno
          in: query
          required: true
          description: Số tiểu khoản.
          schema:
            type: string
        - name: fromdate
          in: query
          required: true
          description: Từ ngày (YYYY-MM-DD).
          schema:
            type: string
        - name: toDate
          in: query
          required: true
          description: Đến ngày (YYYY-MM-DD).
          schema:
            type: string
        - name: page
          in: query
          required: true
          description: Số trang.
          schema:
            type: string
        - name: size
          in: query
          required: true
          description: Kích thước trang.
          schema:
            type: string
        - name: custodycd
          in: query
          required: true
          description: Mã tài khoản lưu ký.
          schema:
            type: string
      responses:
        '200':
          description: Phản hồi thành công
          content:
            application/json:
              schema:
                type: object
                properties:
                  response:
                    type: object
                    properties:
                      totalRow:
                        type: integer
                        format: int64
                        description: Số bản ghi.
                      totalPage:
                        type: integer
                        format: int64
                        description: Số trang.
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            releaseDate:
                              type: string
                              description: Ngày giải ngân.
                            overDueDate:
                              type: string
                              description: Ngày đáo hạn.
                            releasedAmount:
                              type: number
                              format: double
                              description: Gốc giải ngân.
                            printAmount:
                              type: number
                              format: double
                              description: Nợ gốc hiện tại.
                            intAmount:
                              type: number
                              format: double
                              description: Nợ lãi và phí hiện tại.
                            remainingInterestFee:
                              type: number
                              format: double
                              description: Tổng nợ lãi và phí hiện tại.
                            paidInterestFee:
                              type: number
                              format: double
                              description: Tổng lãi và phí đã trả.
                            rate2:
                              type: number
                              format: double
                              description: Lãi suất.
                            releasedDay:
                              type: number
                              format: double
                              description: Số ngày vay.
                            paidFee:
                              type: number
                              format: double
                              description: Phí đã trả.
                            remainingFee:
                              type: number
                              format: double
                              description: Phí còn lại.
              example:
                response:
                  totalRow: 1
                  totalPage: 6
                  data:
                    - releaseDate: '2022-07-11'
                      overDueDate: '2022-10-10'
                      releasedAmount: 14444940
                      printAmount: 0
                      intAmount: 0
                      remainingInterestFee: 0
                      paidInterestFee: 18205
                      rate2: 11.5
                      releasedDay: 4
                      paidFee: 0
                      remainingFee: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  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.