Important Update: Individual Order Status API using Unique Order ID (10 Requests/Second)


  • We're implementing significant enhancements to our trading APIs, with a keen focus on practicality and efficiency for our users. These changes include the introduction of the "uniqueorderid" field in the responses of essential APIs: place order, modify order, cancel order, and orderbook.

    Moreover, we're introducing the "Individual Order Status" API, which grants users access to detailed information about specific individual orders. This means you can skip the hassle of fetching the entire order book when you only need specific order details. Notably, this API offers an impressive rate limit of 10 requests per second, ensuring a smooth and efficient trading experience.

    We believe these improvements will streamline your trading activities, making it easier for you to manage your orders effectively.

    1. Introducing the "Individual Order Status" API:

    This API allows you to retrieve the status of individual orders using the "uniqueorderid" you receive in the response when placing, modifying, or canceling orders.

    API Endpoint: https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/details/{UniqueOrderID}

    Method: GET

    Sample Request:

    https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/details/05ebf91b-bea4-4a1d-b0f2-4259606570e3
    

    Sample Response:

    {
        "status": true,
        "message": "SUCCESS",
        "errorcode": "",
        "data": {
            "variety": "NORMAL",
            "ordertype": "LIMIT",
            "producttype": "DELIVERY",
            "duration": "DAY",
            "price": 2298.25,
            "triggerprice": 0.0,
            "quantity": "1",
            "disclosedquantity": "0",
            "squareoff": 0.0,
            "stoploss": 0.0,
            "trailingstoploss": 0.0,
            "tradingsymbol": "RELIANCE-EQ",
            "transactiontype": "BUY",
            "exchange": "NSE",
            "symboltoken": "2885",
            "instrumenttype": "",
            "strikeprice": -1.0,
            "optiontype": "",
            "expirydate": "",
            "lotsize": "1",
            "cancelsize": "0",
            "averageprice": 0.0,
            "filledshares": "0",
            "unfilledshares": "1",
            "orderid": "231010000000970",
            "text": "Your order has been rejected due to Insufficient Funds. Available funds - Rs. 937.00 . You require Rs. 2298.25 funds to execute this order.",
            "status": "rejected",
            "orderstatus": "rejected",
            "updatetime": "10-Oct-2023 09:00:16",
            "exchtime": "",
            "exchorderupdatetime": "",
            "fillid": "",
            "filltime": "",
            "parentorderid": "",
            "ordertag": "",
            "uniqueorderid": "05ebf91b-bea4-4a1d-b0f2-4259606570e3"
        }
    }
    
    

    Improved Rate Limit:

    We understand the importance of quick decision-making in trading, especially when you need to place orders like stop-loss or target orders after a successful trade. Our "place order" API enables you to send requests rapidly, with a limit of up to 20 requests per second. In the context of order monitoring, the "getorderbook" API is limited to just 1 request per second. However, we're introducing the "Individual Order Status" API, which is designed to allow 10 requests per second. This enhancement provides you with greater flexibility and control when checking the status of your individual orders.

    2. Unique Order ID:

    In conjunction with these enhancements, we are introducing the "Unique Order ID." This identifier will be included in the response every time you interact with our APIs, whether you're placing an order, modifying it, canceling it, or checking your order book. This unique identifier simplifies the process of tracking and managing your orders with precision.

    These updates are aimed at enhancing your trading experience, providing you with the necessary tools, speed, and control to thrive in today's dynamic markets.

    Sample response on place order:

    {
        "status": true,
        "message": "SUCCESS",
        "errorcode": "",
        "data": {
            "script": "IDEA-EQ",
            "orderid": "101105793a45AO",
            "uniqueorderid": "87ae4c65-8e5b-4f4e-b836-8c6cf7b0170b"
        }
    }
    
    

    We hope you find these updates valuable, and we look forward to serving you with an even better trading experience.

    Happy trading!


  • @N399438 said in Important Update: Individual Order Status API using Unique Order ID (10 Requests/Second):

    placeOrderFullResponse

    Hello @N399438,

    try:
    orderparams = {
    "variety": "NORMAL",
    "tradingsymbol": "SBIN-EQ",
    "symboltoken": "3045",
    "transactiontype": "BUY",
    "exchange": "NSE",
    "ordertype": "LIMIT",
    "producttype": "INTRADAY",
    "duration": "DAY",
    "price": "19500",
    "squareoff": "0",
    "stoploss": "0",
    "quantity": "1"
    }
    # Method 1: Place an order and return the order ID
    orderid = obj.placeOrder(orderparams)
    logger.info(f"PlaceOrder : {orderid}")
    # Method 2: Place an order and return the full response
    response = obj.placeOrderFullResponse(orderparams)
    logger.info(f"PlaceOrder : {response}")
    except Exception as e:
    logger.exception(f"Order placement failed: {e}")

    Thank you.

    Regards
    SmartAPI Team


  • @Moderator_1 said in Important Update: Individual Order Status API using Unique Order ID (10 Requests/Second):

    placeOrderFullResponse

    I am etting below error
    'SmartConnect' object has no attribute 'placeOrderFullResponse'


  • @projectSB I figured it out!
    Used the following method. Hope this help others too:

    def individual_order_details(self, qParam):
    url = self._rootUrl + self._routes["api.individual.order.details"] + qParam
    try:
    response_data = self.make_authenticated_get_request(url, self.access_token)
    return response_data
    except Exception as e:
    logger.error(f"Error occurred in ind_order_details: {e}")
    return None


  • @Moderator_1 Much awaited feature! Thanks!
    Just need some more clarification:

    Say I placed an order using "placeOrderFullResponse(orderparams)".

    Now I can extract the uniqueOrderID from the response here. Now what do I do next to get the orderStatus from exchange?

    Which Python function should I use to see whether my order was Completed or not?

    A simple code block to illustrate this would be really appreciated!

    UPDATE: I tried using normal requests (GET) to fetch the order status, but the response says 'Invalid token'.

    {"success":false,"message":"Invalid Token","errorCode":"AG8001","data":""}

    However, I can see that the order in the 'https://www.angelone.in/trade/orders/history'. Please help!


  • Hello @rraavvi007,

    Apologies for delayed response.
    Can you please share your request body? We usually don't have such unannounced maintenance activities.

    Thank you.

    Regards
    SmartAPI Team


  • Hello @milli,
    Yes, there is a function in the python library named "placeOrderFullResponse(orderparams)". Please look it up on our github repository.

    Thank you.

    Regards
    SmartAPI Team


  • Hello @trader_noob, @godboleamit
    As @andyvoid has mentioned, it'll help in tracking modified orders. One more use case is fetching Individual Order Status. Earlier a user had to fetch the whole orderbook and check for their orders, now using the Individual Order Status API and Unique Order ID any user can track their orders instantly. Our main focus for introducing this was to provide a faster response time to order status which can be easily done now using the unique order ID parameter.
    @gjs thank you for suggesting this feature. We have noted this and will update you once it becomes available.
    If you still have any questions, please let us know.

    Thank you.

    Regards
    SmartAPI Team


  • I am not login and order


  • @trader_noob said in Important Update: Individual Order Status API using Unique Order ID (10 Requests/Second):

    uniqueorderid

    I agree to the question by @trader_noob. What's the difference between orderid and uniqueorderid. And when should we use uniqueorderid?


  • @admin

    Is there a comparable function that can be directly called ref. python api to get the order status ?

    thanks


  • @trader_noob The Unique order ID will same if you modify an order. In conjunction modifying the order will create a new Order ID in the market but thus unique order ID won't change. Now it's easier to track modified order


  • hello @admin i am also trying to use the historical API.
    getting-
    {"message":"Internal Error","errorcode":"AB2001","status":false,"data":null}
    Any idea why i get this error?
    Is there any maintenance activity going on?
    My Id is R428907


  • @admin said in Important Update: Individual Order Status API using Unique Order ID (10 Requests/Second):

    re aimed at enhancing your trading experience, providing you with the necessary tools, speed, and control to thrive in today's dynamic mar

    Great update! Thanks for the feature. One small query: Is the existing field "orderid" not unique? What's the exact purpose of "uniqueorderid" that couldn't be solved by that previous one?


  • @admin
    when are you going to offer paper trading through API ?
    It is much requested feature.
    -thanks