Portfolio
This endpoint retrieves the position holdings for a specific portfolio. It returns detailed information about all securities held within the portfolio, including quantities, market data, and status of pending transfers.
📨 HTTP Request
bash
GET /account/v1/portfolios/{id}📥 Query Parameters
| Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
id | string | Yes | Portfolio ID (which is a user-defined external id ) | Maximum length allowed: 50 characters. like :d59c4577-d450-2cbb-43c9-ef06e40f1fde |
✅ Successful Response
Response Fields
| Field | Type | Description |
|---|---|---|
market | enum | Market type. See market enum definition |
product_code | string | Product code (e.g., stock symbol) |
product_name | string | Product name |
qty | decimal | Total position quantity |
os_sell_qty | decimal | Quantity frozen for sell orders |
avail_qty | decimal | Buyable quantity (T+1 for certain markets) |
avail_sell_qty | decimal | Quantity available for sell orders |
uncleared_qty | decimal | Held but not tradable quantity |
base_currency | string | Currency of the position |
avg_cost | decimal | Average cost (including fees) |
avg_price | decimal | Average execution price (excluding fees) |
prev_price | decimal | Previous closing price |
prev_market_value | decimal | Market value based on the previous closing price |
pending_deposit_qty | decimal | Quantity pending inbound transfer |
pending_withdrawal_qty | decimal | Quantity pending outbound transfer |
approved_deposit_qty | decimal | Quantity under approval for inbound transfer |
approved_withdrawal_qty | decimal | Quantity under approval for outbound transfer |
security_type | enum | Type of security. See security_type enum definition |
contract_time | long | Contract date (Unix timestamp in seconds) |
portfolio_id | string | Portfolio ID (which is a user-defined external id ) |
❌ Error Response
| Field | Type | Description |
|---|---|---|
code | int | Error code |
message | string | Error message |
details | string | Additional details |
💡 cURL Example
bash
curl -X GET "https://{{base_url}}/account/v1/portfolios/d59c4577-d450-2cbb-43c9-ef06e40f1fde" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Timestamp: 1746777861334" \
-H "X-API-Signature: YOUR_GENERATED_SIGNATURE" \
-H "Content-Type: application/json"✅ Sample Success Response
json
{
"code": 0,
"data": {
"portfolio_id": "d59c4577-d450-2cbb-43c9-ef06e40f1fde",
"positions": [
{
"market": "usex",
"product_code": "AAPL",
"product_name": "Apple Inc.",
"qty": 100,
"os_sell_qty": 10,
"avail_qty": 90,
"avail_sell_qty": 85,
"uncleared_qty": 5,
"base_currency": "USD",
"avg_cost": 140.5,
"avg_price": 139.0,
"prev_price": 142.3,
"prev_market_value": 14230,
"pending_deposit_qty": 0,
"pending_withdrawal_qty": 0,
"approved_deposit_qty": 0,
"approved_withdrawal_qty": 0,
"security_type": "stock",
"contract_time": 1746775257,
"portfolio_id": "d59c4577-d450-2cbb-43c9-ef06e40f1fde"
}
]
}
}❌ Sample Error Response
json
{
"code": 12010012,
"message": "Internal server error"
}
