Skip to main content

SQUARE-OFF

This API allows you to square off open positions from the net position tab.

It can be used to exit positions based on type, exchange, token, or product type.

🔑 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 / Enum
client_idstringNoClient ID for placing square-off orders"CL12345"
typestringNoPosition type"daily", "expiry"
exchangestringNoExchange segment"NSE_EQ"
tokenintegerNoScrip token12345
intropintegerNoInteroperability flag (0 = OFF, 1 = ON)1
product_typestringNoProduct type"M"

🟢 Success Response - 200 OK

Content-Type: application/json

FieldTypeDescriptionExample
statusstringStatus of API call"success"
codestringResponse code to user request"s-101"
messagestringSuccess message"Positions squared off successfully"
dataarrayList of square-off resultsRefer to Data Object Fields

📦 Data Object Fields

FieldTypeDescriptionExample
scrip_tokenstringScrip token identifier"12345"
symbolstringScrip symbol"INFY"
statusstringStatus of order placement"success"
messagestringResult message"Order placed successfully"
dataobjectOrder responseRefer below

📘 Nested Data Object

FieldTypeDescriptionExample
orderIdstringSystem-generated order identifier"ORD654321"