pocketful logo light
pocketful logo light

Convert Position

Convert Position API is used to change the position of an order from delivery to intraday and vice versa.

Endpoint: /api/v1/position/convert
Method-Type: PUT

Headers

Header NameValueDescription
x-authorization-token<your_access_token>Valid JWT token for authentication
x-device-typeWEBThe device type (e.g., WEB, ANDROID, IOS)
Content-Typeapplication/jsonFormat of the request body

Request Packet

{
    "client_id": "<client id>",
    "exchange": "NSE",
    "instrument_token": 13342,
    "product": "MIS",
    "new_product": "CNC",
    "quantity": 1,
    "validity": "DAY",
    "order_side": "BUY"
}

Request Parameters

FieldNameDatatypeDescription
exchangeStringNSEBSENFOMCX
instrument_tokenStringRepresents the unique id of instrument.
client_idStringRepresents the unique id of user.
order_sideStringBUY or SELL
quantityIntegerQuantity of the instrument
validityStringDAY or IOC
productStringCurrent product type: CNCMISNRMLMTF
new_productStringTarget product type: CNCMISNRMLMTF

Example cURL Request

curl --location --request PUT 'https://algo.pocketful.in/api/v1/position/convert' \
--header 'Content-Type: application/json' \
--header 'x-authorization-token: <your_access_token>' \
--header 'x-device-type: WEB' \
--data '{
    "client_id": "<client id>",
    "exchange": "NSE",
    "instrument_token": 13342,
    "product": "MIS",
    "new_product": "CNC",
    "quantity": 1,
    "validity": "DAY",
    "order_side": "BUY"
}'

Response

{
    "data": {},
    "message": "Conversion completed",
    "status": "success"
}

Error Response

{
    "data": {},
    "message": "Request forbidden",
    "error_code": 40000,
    "status": "error"
}