Skip to main content

SQUARE-OFF ALL ORDERS API (NET POSITIONS)

This API allows you to square off all open positions from the net position tab by placing corresponding exit orders.

It behaves similar to placing orders, but is specifically used for closing existing positions.

🔑 Header Parameters

HeaderTypeDescriptionExample
Content-TypestringSpecifies the media type of the requestapplication/json
AuthorizationstringAccess token for authenticated requests{{access_token}}
x-api-keystringAPI key used to authorize the request{{x-api-key}}

📑 Request Body Parameters

FieldTypeRequiredDescriptionExample
client_idstringNoClient ID for placing square-off orders"CL12345"
scrip_infoobjectYesInstrument detailsRefer below
transaction_typestringYesBUY or SELL (opposite of position)"SELL"
product_typestringYesProduct type"MIS"
order_typestringYesOrder type"MKT"
quantityintegerYesQuantity to square off10
pricenumberNoPrice100.5
trigger_pricenumberNoTrigger price (SL orders)99
disclosed_quantityintegerNoDisclosed quantity5
validitystringNoOrder validity"DAY"
is_amobooleanNoAMO flagfalse
order_identifierstringNoCustom order ID (≤10 chars)"SQOFF1"
part_codestringNoParticipant code"PC001"
algo_idstringNoAlgo ID"ALG01"
strategy_idstringNoStrategy ID"STR01"
vender_codestringNoVendor code"VEN01"

📘 Scrip Info Object Fields

FieldTypeRequiredDescriptionExample / Enum
exchangestringYesExchange segment"NSE_EQ"
scrip_tokenintegerNoExchange token12345
symbolstringNoSymbol"TCS"
seriesstringNoSeries (equity)"EQ"
expiry_datestringNoExpiry date (YYYY-MM-DD)"2026-06-25"
strike_pricenumberNoStrike price3500
option_typestringNoOption type"CE"

🟢 Success Response - 200 OK

Content-Type: application/json

FieldTypeDescriptionExample
statusstringStatus of API call"success"
codestringResponse code to user request"200"
messagestringSuccess message"Positions squared off successfully"
dataarrayList of order resultsRefer to Data Object Fields

📦 Data Object Fields

FieldTypeDescriptionExample
statusstringStatus of order placement"success"
codestringResponse code"s-101"
messagestringResult message"Order placed successfully"
dataobjectOrder responseRefer below

📘 Nested Data Object

FieldTypeDescriptionExample
orderIdstringSystem-generated order identifier"ORD987654"