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 | Type | Description | Example |
|---|
| Content-Type | string | Specifies the media type of the request | application/json |
| Authorization | string | Access token for authenticated requests | {{access_token}} |
| x-api-key | string | API key used to authorize the request | {{x-api-key}} |
📑 Request Body Parameters
| Field | Type | Required | Description | Example |
|---|
| client_id | string | No | Client ID for placing square-off orders | "CL12345" |
| scrip_info | object | Yes | Instrument details | Refer below |
| transaction_type | string | Yes | BUY or SELL (opposite of position) | "SELL" |
| product_type | string | Yes | Product type | "MIS" |
| order_type | string | Yes | Order type | "MKT" |
| quantity | integer | Yes | Quantity to square off | 10 |
| price | number | No | Price | 100.5 |
| trigger_price | number | No | Trigger price (SL orders) | 99 |
| disclosed_quantity | integer | No | Disclosed quantity | 5 |
| validity | string | No | Order validity | "DAY" |
| is_amo | boolean | No | AMO flag | false |
| order_identifier | string | No | Custom order ID (≤10 chars) | "SQOFF1" |
| part_code | string | No | Participant code | "PC001" |
| algo_id | string | No | Algo ID | "ALG01" |
| strategy_id | string | No | Strategy ID | "STR01" |
| vender_code | string | No | Vendor code | "VEN01" |
📘 Scrip Info Object Fields
| Field | Type | Required | Description | Example / Enum |
|---|
| exchange | string | Yes | Exchange segment | "NSE_EQ" |
| scrip_token | integer | No | Exchange token | 12345 |
| symbol | string | No | Symbol | "TCS" |
| series | string | No | Series (equity) | "EQ" |
| expiry_date | string | No | Expiry date (YYYY-MM-DD) | "2026-06-25" |
| strike_price | number | No | Strike price | 3500 |
| option_type | string | No | Option type | "CE" |
🟢 Success Response - 200 OK
Content-Type: application/json
| Field | Type | Description | Example |
|---|
| status | string | Status of API call | "success" |
| code | string | Response code to user request | "200" |
| message | string | Success message | "Positions squared off successfully" |
| data | array | List of order results | Refer to Data Object Fields |
📦 Data Object Fields
| Field | Type | Description | Example |
|---|
| status | string | Status of order placement | "success" |
| code | string | Response code | "s-101" |
| message | string | Result message | "Order placed successfully" |
| data | object | Order response | Refer below |
📘 Nested Data Object
| Field | Type | Description | Example |
|---|
| orderId | string | System-generated order identifier | "ORD987654" |