Skip to main content

Cancel Multileg/Spread Order

This API cancels an existing multileg/spread order that is pending in order book

🛣️Path Parameters

FieldsTypeRequiredDescriptionExample/Enum
order_flagstringYesAction to be performed (should be cancel)cancel
gateway_order_nointegeryesGateway order number of the multi-leg order0409005

🔑Header Parameters

FieldsTypeRequiredDescriptionExample/Enum
AuthorizationstringyesBearer token for authenticationaccess_token
x-api-keystringYesAPI key provided by bearerx-api-key
Content_typestringyesType of content being sentapplication/json
ParameterTypeRequiredDescriptionExample
order_flagstringYesAction flag; must be "cancel" for cancellation"cancel"
gateway_order_nointegerYesGateway order number returned in the Place Multileg Order response032800024

🔑 Header Parameters

HeaderTypeRequiredDescriptionExample
AuthorizationstringYesBearer token for authenticated requests{{access_token}}
x-api-keystringYesAPI key used to authorize the request{{x-api-key}}
Content-TypestringYesSpecifies the media type of the requestapplication/json

📑 Request Body Parameters

Same structure as Place Multileg/Spread Order — pass all leg details with the same leg data used when the order was placed.

FieldTypeRequiredDescriptionExample / Enum
typestringYesLeg type indicator matching the original order"2L", "3L", "SPREAD"
validitystringYesMust be "IOC""IOC"
prot_percstringNoProtection percentage; leave empty""
order_timeintegerNoReserved field; send 00
order_identifierstringNoOriginal order identifier"1357470777"
leg_detailsarrayYesArray of leg objects matching the original orderRefer below

📘Leg Details object fields

FieldsTypeRequiredDescriptionExample/Enum
leg_nointegerYesIdentifier of the leg1
scrip_infoobjectyesInstrument detailsSee below table
transactional_typestringyesBuy or sellSELL
quantitynumberyesQuantity for this leg75
pricestringYesPrice of the leg"250.50"
othersobjectYesLot size and price tick detailsSee below table

📑Scrip info object fields

FieldsTypeRequiredDescriptionExample/Enum
exchangestringyesExchange segmentsNSE_FO
scrip_tokenintegerOptionalUnique token id of the instrument123456
symbolstringOptionalSymbol of the scripRELIANCE 
seriesstringOptionalSeries (for equities)EQ
expiry_datestringOptionalExpiry date (yyyy-mm-dd) for F&O2025-06-05
strike_pricenumberOptionalStrike price in paise (for options)255000
option_typestringOptionaloption type: "CE" call or "PE" putPE

📑Others object fields

FieldsTypeRequiredDescriptionExample/Enum
market_lotintegerYesLot size75
price_ticknumberYesPrice movement increment0.05
decimal_locnumberYesDecimal locator for precision2

🟢Success Response - 200 OK

FieldsTypeDescriptionExample/Enum
StatusstringStatus of API Call"success"
CodestringResponse code"s-101"
messagestringConfirmation Message"Order submitted for cancellation"
dataobjectContain additional detailsSee below table

📄Data Object Info Field

FieldTypeDescriptionExample/Enum
order idstringInternal order ID assigned by system"SPRD12345"
gateway_order_nostringGateway order reference number"04567435
Important Note

gateway_order_no must be taken from the Place Multileg Order response. It is not the same as orderId.