Skip to main content

Orders

Cancel Order

A cancelled order is a previously submitted order to buy or sell a security that gets cancelled before it executes on an exchange.

As long as an order remains active or in a state of pending in the system, it can be canceled.

Method: POST

https://connect-go.thefirstock.tech/api/V5/cancel-order

Request details

API Parameters
Parameter Value Type Mandatory
userId NP2997 String Yes
jKey abc123 String Yes
norenordno 24121300003425 Integer Yes
gui_order_id 7effc889-f83f-4683-93fc-b4f2755bbd42 String No
ordersource WEB String Yes
handlinst test235 String No
channel MacOS String No
usr_agent BrowserAgent.Chrome String No
app_inst_id 8195b6ff-1ba3-423a-9298-fb0e4e095bcd String Yes
ip_address 1.1.1.1 String Yes

Libraries and SDKs

Tabbed Interface
curl --location --request POST 'https://connect.thefirstock.com/api/V4/cancelOrder' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ExternalRemarks": "test235",
        "GuiOrdId": "7effc889-f83f-4683-93fc-b4f2755bbd42",
        "NorenOrdNum": 24121300003425,
        "RejReason": "Trying to cancel a non-existing order",
        "ReqStatus": "NOT_OK"

}'


Success response details

API Parameters
Parameter Description Example
data.requestTime
string
Indicates the time at which the response
was received, providing a timestamp for
the transaction.
14:45:38 15-02-2023
status
string
Represents the status of the API
request, indicating whether it
was processed successfully or not.
success
data.orderNumber
string
Unique identifier for the order,
provided upon successful placement
23111100000112
{
    "status": "success",
    "message": "Order details",
    "data": {
        "ExternalRemarks": "test235",
        "GuiOrdId": "7effc889-f83f-4683-93fc-b4f2755bbd42",
        "NorenOrdNum": 24121300003425,
        "RejReason": "Trying to cancel a non-existing order",
        "ReqStatus": "NOT_OK"
    }
}

Failure response details

API Error Parameters
Parameter Description Example
status
String
Indicates the result status of the API operation failed
code
String
HTTP status code associated with the error 404
name
String
Specifies the type or category of the
error encountered
ORDER_NOT_FOUND
error.field
String
Field in the request that triggered the error orderNumber
error.message
String
Detailed message describing the error Order not found to cancel
{ 
  "status": "failed",
  "code": "404", 
    "name": "ORDER_NOT_FOUND",
    "error": {   
      "field": "orderNumber",    
      "message": "Order not found to cancel"  
  }
}