Skip to content

Cancel Order

As long as an order is open or pending in the system, it can be canceled.

POST: /api/cancelOrder

https://connect.thefirstock.com/api/cancelOrder

Request Details

Parameter Description
norenordno Noren order number, which needs to be cancelled
userId User Id of the login user
jKey Key Obtained on login success.

Code

from thefirstock import thefirstock

cO = thefirstock.firstock_cancelOrder(
    norenordno='norenordno', #Replace with the norenordno
) 
curl -X POST 'https://connect.thefirstock.com/api/cancelOrder' \
    -H 'Content-Type: application/json' \
    -d '{
        "userId": "",
        "jKey": "",
        "norenordno": ""
        }'
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.cancelOrder({norenordno:""},(err, result)=>{
    console.log("Error, ", err)
    console.log("Result: ", result)
})
using thefirstock;

class Program
{
public static void Main()
{
    Firstock firstock = new Firstock();
    var result = firstock.cancelOrder(norenordno: "");
}
}

Response Details

Parameter Description
stat Ok or Not_Ok Place order success or failure indication
result Noren Order number of the canceled order.
requestTime Response received time.
emsg This will be present only if Order cancelation fails

Sample Response

{
"request_time":"23:59:20 29-05-2022",
"stat":"Ok",
"result":"22052800000038"
}    
{
"request_time":"16:01:48 28-05-2020",
"stat":"Not_Ok",
"emsg":"Rejected : ORA:Order not found to Cancel"
}