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
| Header Name | Value | Description |
|---|
| x-authorization-token | <your_access_token> | Valid JWT token for authentication |
| x-device-type | WEB | The device type (e.g., WEB, ANDROID, IOS) |
| Content-Type | application/json | Format 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
| FieldName | Datatype | Description |
|---|
| exchange | String | NSE, BSE, NFO, MCX |
| instrument_token | String | Represents the unique id of instrument. |
| client_id | String | Represents the unique id of user. |
| order_side | String | BUY or SELL |
| quantity | Integer | Quantity of the instrument |
| validity | String | DAY or IOC |
| product | String | Current product type: CNC, MIS, NRML, MTF |
| new_product | String | Target product type: CNC, MIS, NRML, MTF |
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"
}