Get MTF Positions
API to retrieve the current Margin Trade Funding (MTF) positions for the user. MTF is a facility that allows investors to buy securities by paying a fraction of the transaction value, with the remaining amount funded by the Upstox. These positions remain in the MTF portfolio until they are either sold or the loan is repaid.
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Responses
- 200
Response Body
{
"status": "success",
"data": [
{
"exchange": "NSE",
"multiplier": 1.0,
"value": 4285.0,
"pnl": 128.55,
"product": "MTF",
"instrument_token": "NSE_EQ|INE062A01020",
"average_price": 571.33,
"buy_value": 4285.0,
"overnight_quantity": 5,
"day_buy_value": 2856.65,
"day_buy_price": 571.33,
"overnight_buy_amount": 1428.35,
"overnight_buy_quantity": 2,
"day_buy_quantity": 5,
"day_sell_value": 0.0,
"day_sell_price": 0.0,
"overnight_sell_amount": 0.0,
"overnight_sell_quantity": 0,
"day_sell_quantity": 0,
"quantity": 7,
"last_price": 589.75,
"unrealised": 128.55,
"realised": 0.0,
"sell_value": 0.0,
"trading_symbol": "SBIN",
"close_price": 572.65,
"buy_price": 571.33,
"sell_price": 0.0
},
{
"exchange": "NSE",
"multiplier": 1.0,
"value": 58300.0,
"pnl": 350.0,
"product": "MTF",
"instrument_token": "NSE_EQ|INE002A01018",
"average_price": 2915.0,
"buy_value": 58300.0,
"overnight_quantity": 20,
"day_buy_value": 0.0,
"day_buy_price": 0.0,
"overnight_buy_amount": 58300.0,
"overnight_buy_quantity": 20,
"day_buy_quantity": 0,
"day_sell_value": 0.0,
"day_sell_price": 0.0,
"overnight_sell_amount": 0.0,
"overnight_sell_quantity": 0,
"day_sell_quantity": 0,
"quantity": 20,
"last_price": 2932.5,
"unrealised": 350.0,
"realised": 0.0,
"sell_value": 0.0,
"trading_symbol": "RELIANCE",
"close_price": 2920.75,
"buy_price": 2915.0,
"sell_price": 0.0
}
]
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Typically success for successful operations. |
data | object[] | Response data for MTF position details |
data[].exchange | string | Exchange to which the order is associated. For MTF positions, valid exchange is NSE only. |
data[].multiplier | float | The quantity/lot size multiplier used for calculating P&Ls |
data[].value | float | Net value of the position |
data[].pnl | float | Profit and loss - net returns on the position |
data[].product | string | For MTF positions, this will always be 'MTF' |
data[].instrument_token | string | Key of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
data[].average_price | float | Average price at which the net position quantity was acquired |
data[].buy_value | float | Net value of the bought quantities |
data[].overnight_quantity | int32 | Quantity held previously and carried forward over night |
data[].day_buy_value | float | Amount at which the quantity is bought during the day |
data[].day_buy_price | float | Average price at which the day qty was bought. Default is empty string |
data[].overnight_buy_amount | float | Amount at which the quantity was bought in the previous session |
data[].overnight_buy_quantity | int32 | Quantity bought in the previous session |
data[].day_buy_quantity | int32 | Quantity bought during the day |
data[].day_sell_value | float | Amount at which the quantity is sold during the day |
data[].day_sell_price | float | Average price at which the day quantity was sold |
data[].overnight_sell_amount | float | Amount at which the quantity was sold in the previous session |
data[].overnight_sell_quantity | int32 | Quantity sold short in the previous session |
data[].day_sell_quantity | int32 | Quantity sold during the day |
data[].quantity | int32 | Quantity left after nullifying Day and CF buy quantity towards Day and CF sell quantity |
data[].last_price | float | Last traded market price of the instrument |
data[].unrealised | float | Day PnL generated against open positions |
data[].realised | float | Day PnL generated against closed positions |
data[].sell_value | float | Net value of the sold quantities |
data[].trading_symbol | string | Shows the trading symbol of the instrument |
data[].close_price | float | Closing price of the instrument from the last trading day |
data[].buy_price | float | Average price at which quantities were bought |
data[].sell_price | float | Average price at which quantities were sold |
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.
GET /portfolio/mtf-positions
Request
Request
curl / cURL
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
python / requests
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
go / native
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
nodejs / axios
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
ruby / Net::HTTP
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
csharp / httpclient
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
php / cURL
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
java / unirest
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'
powershell / RestMethod
curl -L -X GET 'https://api.upstox.com/v3/portfolio/mtf-positions' \
-H 'Accept: application/json'