# Positions 

## GET /api/oms/positions

Positions 

to get a list of positions records

**MTM Calculations:**
- **Realized:** realizedPnl
- **UnRealized:** ( netQty * ( LTP - netAvgPrice)) * multiplier * pricefactor
- **Total MTM:** Realized + UnRealized

**P&L Calculations:**
- **Realized:** realizedOrgPnl
- **UnRealized:** ( netQty * ( LTP - netOrgAvgPrice)) * multiplier * pricefactor
- **Total P&L:** Realized + UnRealized

**Day Positions - MTM Calculations:**
- **Realized:** dayRealizedPnl
- **UnRealized:** ( dayQty * ( LTP - dayAvg)) * multiplier * pricefactor
- **Total Day MTM:** Realized + UnRealized

**Note:**
- For the commodity (MCX), the net quantity should be multiplied by the lot size in the above calculations.
- The LTP mentioned above should be retrieved from real-time updates via the streaming SDK

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| Authorization | header | string | Yes | Access token in the following format:  Bearer <api_key>:<access_token>  Both values are required. The `api_key` is your app credential from the Apps Section. The `access_token` is obtained from the authentication endpoint and is valid for 24 hours. |
| symDetails | query | boolean (true | false) | No | Sending symDetails:'true' - will provide the symbol object in response for every record. Symbol object contains details such as price-tick, lotsize, token etc.., |

### Responses

#### 200 — OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("ok" | "no-data" | "error") | No |  |
| d | object[] | No |  |
| d[].symId | string | No |  |
| d[].product | string ("delivery" | "normal" | "intraday" | "cover" | "bracket") | No |  |
| d[].buyQty | number | No |  |
| d[].buyValue | number | No |  |
| d[].buyAvgPrice | number | No |  |
| d[].sellQty | number | No |  |
| d[].sellValue | number | No |  |
| d[].sellAvgPrice | number | No |  |
| d[].cfQty | number | No | Carry forward positions quantity |
| d[].cfValue | number | No | Carry forward position value and it is calculated using cfQty * cfAvgPrice * multiplier * pricefactor. |
| d[].cfAvgPrice | number | No | The settlement price of the scrip from the last trading day, is used to calculate the mark-to-market (MTM) of the positions |
| d[].netQty | number | No |  |
| d[].netAvgPrice | number | No | The net average price is based on today's positions and carryforward positions. For carryforward positions, the average would be the settlement price from the last trading day (cfavgprice), while for today's positions, the average would be the day average price (dayavgprice) |
| d[].netValue | number | No | Net value of the position based on the net average price (netavgprice) |
| d[].realizedPnl | number | No | Realized pnl value |
| d[].priceFactor | number | No | Used for pnl calculations. PriceFactor:(General Numerator * Price Numerator)/(General Denominator * Price Denopminator) |
| d[].multiplier | number | No |  |
| d[].sym | object | No |  |
| d[].sym.id | string | No |  |
| d[].sym.symbol | string | No |  |
| d[].sym.tradSymbol | string | No |  |
| d[].sym.exchange | string | No |  |
| d[].sym.lot | string | No |  |
| d[].sym.instrument | string | No |  |
| d[].sym.companyName | string | No |  |
| d[].sym.expiry | string | No |  |
| d[].sym.dispSymbol | string | No |  |
| d[].sym.asset | string | No |  |
| d[].sym.empty | boolean | No |  |
| d[].cfOrgAvgPrice | number | No | The actual buy/sell price of the position, is used to calculate the overall PNL of the positions. |
| d[].cfOrgValue | number | No | Carry forward position original value and it is calculated using cfQty * cfOrgAvgPrice * multiplier * pricefactor |
| d[].netOrgAvgPrice | number | No | The net original average price is based on today's positions and carryforward positions. For carryforward positions, the average would be the actual buy or sell price of the scrip, while for today's positions, the average would be the day average price (dayavgprice) |
| d[].netOrgValue | number | No | Net original value of the position based on the net original average price (netorgavgprice) |
| d[].realizedOrgPnl | number | No |  |
| d[].dayPos | object | No | Today's position details |
| d[].dayPos.dayQty | number | No |  |
| d[].dayPos.dayAvg | number | No |  |
| d[].dayPos.dayRealizedPnl | number | No |  |
| d[].dayPos.dayNetValue | number | No | dayNetValue is calculated by 'dayBuyValue - daySellValue'. |
| d[].dayPos.convertPos | boolean | No |  |
| d[].dayPos.dayPremium | number | No |  |
| d[].convertPos | boolean | No |  |
| d[].netPremium | number | No |  |
| d[].transHistory | boolean | No |  |
| d[].createTSL | boolean | No |  |
| msg | string ("no-data" | "error msg") | No |  |
| s | string ("ok" | "error" | "no-data") | No |  |

#### 401 — Unauthorized — one of: (1) invalid or expired access token — tokens expire after 24 hours, re-authenticate to get a new one; (2) `Authorization` header missing or malformed — use format `Bearer <api_key>:<access_token>`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string ("Unauthorized") | No | Error message. |

#### 429 — Too Many Requests — rate limit exceeded. General API: 10 req/sec per auth token (400 req/min).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string | No | Error message indicating the rate limit was exceeded. |

#### 500 — Internal Server Error — retry with backoff; contact support if it persists.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string | No | Error message. |