Lịch sử giao dịch cổ phiếu
API lấy danh sách lịch sử giao dịch mua/bán cổ phiếu của danh mục đầu tư.
HTTP request
- URL:
/api/personalize/v1/partner/portfolio/stock-transactions - Method:
POST - Content Type: application/json
- Response Type: application/json
Tham số header
| Header | Mô tả | Kiểu dữ liệu | Bắt buộc |
|---|---|---|---|
| X-Api-Key | Khóa duy nhất. | string | có |
Tham Số Truy Vấn (Query Parameters)
| Tên Tham Số | Kiểu Dữ Liệu | Bắt buộc | Mô Tả |
|---|---|---|---|
| externalUserId | string | có | ID người dùng duy nhất từ hệ thống của đối tác. |
| recvWindow | string | không | Thời gian chấp nhận (ms), default: 5000 |
| timestamp | string | có | Unix timestamp (milliseconds). |
| signature | string | có | HMAC-SHA256 signature. |
Yêu Cầu (Request)
Request Mẫu
{
"ticker": null,
"transactionTypes": null,
"fromDate": "28/01/2023",
"toDate": "28/01/2026",
"page": 0,
"size": 15,
"portfolioId": 862
}
Chi Tiết Tham Số Request Body
| Tên Thuộc Tính | Kiểu Dữ Liệu | Mô Tả |
|---|---|---|
| ticker | string | Mã cổ phiếu cần lọc (VD: "ACV,BVH"; null = tất cả). Lấy ticker trong stocksSummary trong api Chi tiết danh mục |
| transactionTypes | string | Danh sách loại giao dịch cần lọc (VD: "1,2,3,4"): - null: Tất cả - 1: Mua - 2: Bán - 3: Cổ tức tiền - 4: Cổ tức cổ phiếu |
| fromDate | string | Ngày bắt đầu (dd/MM/yyyy). |
| toDate | string | Ngày kết thúc (dd/MM/yyyy). |
| page | number | Số trang (bắt đầu từ 0). |
| size | number | Số lượng bản ghi mỗi trang. |
| portfolioId | number | ID danh mục đầu tư. |
Phản Hồi (Response)
Response Mẫu
{
"status": 200,
"message": "Success",
"total": 24,
"data": [
{
"portfolioId": 862,
"id": 969078,
"ticker": "HPG",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 4432,
"price": 2311,
"value": 10242352,
"transactionFee": 0,
"transactionFeeValue": 0,
"totalValue": 10242352,
"createdDate": "09/01/2026 11:37",
"date": "09/01/2026 10:00",
"note": "Chuyển kho 1000 HPG từ VPS về",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969068,
"ticker": "HPG",
"transactionTypeName": "Bán",
"transactionType": "SELL",
"volume": 100,
"price": 26133.412800000006,
"value": 2613341.28,
"transactionFee": 0,
"transactionFeeValue": 0,
"totalValue": 2613341.2800000007,
"createdDate": "09/01/2026 09:42",
"date": "30/12/2025 15:00",
"note": "Transfer to SSI Securities",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969062,
"ticker": "HPG",
"transactionTypeName": "Bán",
"transactionType": "SELL",
"volume": 100,
"price": 26133.412800000006,
"value": 2613341.28,
"transactionFee": 0.1,
"transactionFeeValue": 2613.34,
"totalValue": 2613341.0800000005,
"createdDate": "08/01/2026 17:29",
"date": "30/12/2025 15:00",
"note": "Transfer to SSI Securities",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969067,
"ticker": "HPG",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 200,
"price": 26500,
"value": 5300000,
"transactionFee": 0,
"transactionFeeValue": 0,
"totalValue": 5300000,
"createdDate": "09/01/2026 09:29",
"date": "30/12/2025 14:00",
"note": "Transfer from VPS Securities - cost price 26,500",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969061,
"ticker": "HPG",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 200,
"price": 26500,
"value": 5300000,
"transactionFee": 0.1,
"transactionFeeValue": 5300,
"totalValue": 5300000.2,
"createdDate": "08/01/2026 17:29",
"date": "30/12/2025 14:00",
"note": "Transfer from VPS Securities - cost price 26,500",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969060,
"ticker": "HPG",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 200,
"price": 26500,
"value": 5300000,
"transactionFee": 0.1,
"transactionFeeValue": 5300,
"totalValue": 5300000.2,
"createdDate": "08/01/2026 17:29",
"date": "30/12/2025 14:00",
"note": "Transfer from VPS Securities - cost price 26,500",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969057,
"ticker": "HPG",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 200,
"price": 26500,
"value": 5300000,
"transactionFee": 0.1,
"transactionFeeValue": 5300,
"totalValue": 5300000.2,
"createdDate": "08/01/2026 17:08",
"date": "30/12/2025 14:00",
"note": "Transfer from VPS Securities - cost price 26,500",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969080,
"ticker": "VCB",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 100,
"price": 85000,
"value": 8500000,
"transactionFee": 0,
"transactionFeeValue": 0,
"totalValue": 8500000,
"createdDate": "09/01/2026 14:50",
"date": "30/12/2025 11:00",
"note": "Exercise VCB rights - ratio 5:1",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969073,
"ticker": "VCB",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 333,
"price": 85000,
"value": 28305000,
"transactionFee": 0,
"transactionFeeValue": 0,
"totalValue": 28305000,
"createdDate": "09/01/2026 09:56",
"date": "30/12/2025 11:00",
"note": "Exercise VCB rights - ratio 5:1",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969065,
"ticker": "VCB",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 100,
"price": 85000,
"value": 8500000,
"transactionFee": 0.1,
"transactionFeeValue": 8500,
"totalValue": 8500000.2,
"createdDate": "08/01/2026 17:29",
"date": "30/12/2025 11:00",
"note": "Exercise VCB rights - ratio 5:1",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969056,
"ticker": "VNM",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": -60,
"price": 77000,
"value": -4620000,
"transactionFee": 9625,
"transactionFeeValue": -444675000,
"totalValue": -4609412,
"createdDate": "08/01/2026 15:41",
"date": "30/12/2025 10:30",
"note": "Sell order #123457",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969055,
"ticker": "VNM",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 100,
"price": 77000,
"value": 7700000,
"transactionFee": 9625,
"transactionFeeValue": 741125000,
"totalValue": 7710588,
"createdDate": "08/01/2026 15:39",
"date": "30/12/2025 10:30",
"note": "Sell order #123457",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969053,
"ticker": "VNM",
"transactionTypeName": "Bán",
"transactionType": "SELL",
"volume": 50,
"price": 805.8938667944418,
"value": 40294.69,
"transactionFee": 9625,
"transactionFeeValue": 3878364.23,
"totalValue": 32102.47676090082,
"createdDate": "08/01/2026 13:56",
"date": "30/12/2025 10:30",
"note": "Sell order #123457",
"dividendCash": 2396,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969052,
"ticker": "HAG",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 110,
"price": 2000,
"value": 220000,
"transactionFee": 10,
"transactionFeeValue": 22000,
"totalValue": 220018,
"createdDate": "08/01/2026 13:56",
"date": "30/12/2025 09:15",
"note": "Buy order #12456",
"dividendCash": 0,
"dividendStock": 0
},
{
"portfolioId": 862,
"id": 969051,
"ticker": "VNM",
"transactionTypeName": "Mua",
"transactionType": "BUY",
"volume": 11,
"price": 22000,
"value": 242000,
"transactionFee": 18750,
"transactionFeeValue": 45375000,
"totalValue": 262625,
"createdDate": "08/01/2026 11:32",
"date": "30/12/2025 09:15",
"note": "Buy order #12456",
"dividendCash": 0,
"dividendStock": 0
}
]
}
Chi Tiết Tham Số Response
| Tên Thuộc Tính | Kiểu Dữ Liệu | Mô Tả |
|---|---|---|
| status | number | Mã trạng thái HTTP. |
| message | string | Thông báo kết quả. |
| total | number | Tổng số bản ghi. |
| data | array (Xem chi tiết) | Danh sách giao dịch cổ phiếu. |
| Tên Thuộc Tính | Kiểu Dữ Liệu | Mô Tả |
|---|---|---|
| portfolioId | number | ID danh mục đầu tư. |
| id | number | ID giao dịch. |
| ticker | string | Mã cổ phiếu. |
| transactionTypeName | string | Tên loại giao dịch. |
| transactionType | string | Mã loại giao dịch: - BUY: mua vào - SELL: bán ra - DIVIDEND_CASH: Trả cổ tức bằng tiền mặt - DIVIDEND_STOCK: Trả cổ tức bằng cổ phiếu |
| volume | number | Khối lượng giao dịch. |
| price | number | Giá giao dịch. |
| value | number | Giá trị giao dịch (chưa bao gồm thuế, phí) |
| transactionFee | number | Phí giao dịch (%). |
| transactionFeeValue | number | Giá trị phí giao dịch. |
| totalValue | number | Tổng giá trị giao dịch (đã bao gồm thuế, phí). |
| createdDate | string | Ngày tạo bản ghi. |
| date | string | Ngày giao dịch (Định dạng: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'). |
| note | string | Diễn giải giao dịch (text) |
| dividendCash | number | Cổ tức tiền mặt. |
| dividendStock | number | Cổ tức cổ phiếu. |