Skip to main content

Convert Positions

API to convert your intraday positions into delivery trades or your margin trades into cash and carry, and vice versa. Position would be converted only if the required margin is available. Delivery holdings can be converted to Intraday positions only if it is purchased on the same day before the auto square off timing. Only simple order can be converted from Intraday to delivery, Special orders like CO cannot be converted from intraday to delivery.

Request

curl --location --request PUT 'https://api.upstox.com/v2/portfolio/convert-position' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}' \
--data '{
"instrument_token": "NSE_EQ|INE528G01035",
"new_product": "D",
"old_product": "I",
"transaction_type": "BUY",
"quantity": 1
}'

For additional samples in various languages, please refer to the Sample code section on this page.

Request Body

NameRequiredTypeDescription
instrument_tokentruestringKey of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix.
new_producttruestringIndicates the new product to use for the convert positions.
Possible values: I, D.
old_producttruestringIndicates the old product to use for the convert positions.
Possible values: I, D.
transaction_typetruestringIndicates whether its a buy(b) or sell(s) order.
Possible values: BUY, SELL.
quantitytrueint32Quantity with which the position to convert
Responses

Response Body

{
"status": "success",
"data": {
"status": "complete"
}
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobjectResponse data for convert position request
data.statusstringStatus message for convert position request

Sample Code

Convert a position from intraday to delivery

curl --location --request PUT 'https://api.upstox.com/v2/portfolio/convert-position' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}' \
--data '{
"instrument_token": "NSE_EQ|INE528G01035",
"new_product": "D",
"old_product": "I",
"transaction_type": "BUY",
"quantity": 1
}'

Convert a position from delivery to intraday

curl --location --request PUT 'https://api.upstox.com/v2/portfolio/convert-position' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}' \
--data '{
"instrument_token": "NSE_EQ|INE528G01035",
"new_product": "I",
"old_product": "D",
"transaction_type": "BUY",
"quantity": 1
}'
Loading...