Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. Ranga
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    Ranga

    @Ranga

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Ranga Unfollow Follow

    Latest posts made by Ranga

    • SmartAPI cancelOrder API fails with AB2001 for STOPLOSS_LIMIT orders (Manual Cancel Works)

      Hi Team,

      I’ve encountered a serious issue with the SmartAPI cancelOrder API, which fails to cancel pending STOPLOSS_LIMIT orders, even though the same orders can be cancelled manually from the Angel One app or web platform. Mainly during after market hours

      Problem Description:
      When I attempt to cancel a STOPLOSS_LIMIT order using:

      cancelOrder(orderid='XX', variety='STOPLOSS')
      

      I consistently receive this error response:

      {
        Response: {'message': 'Internal Error', 'errorcode': 'AB2001', 'status': False, 'data': None}
      }
      

      I also tried fallback varieties 'NORMAL' and 'AMO', but the result is the same.

      Things I’ve Verified:

      • orderstatus is 'open'
      • ordertype is 'STOPLOSS_LIMIT'
      • variety is 'STOPLOSS' (as returned from orderBook())
      • I’m using the correct orderid
      • Manual cancel via Angel One web/app works perfectly
      • Tried multiple orders, same result

      Sample Order Details:

      {
        "orderid": "XXXXX",
        "variety": "STOPLOSS",
        "ordertype": "STOPLOSS_LIMIT",
        "orderstatus": "open",
        "tradingsymbol": "NIFTY03JUL2526000CE",
        "producttype": "CARRYFORWARD"
      }
      

      Expected Behavior:
      The API should cancel the order just like the app or terminal does.

      Actual Behavior:

      • cancelOrder() returns AB2001 Internal Error
      • Order remains open
      • Can be cancelled only manually (which defeats the purpose of automation)

      Suggested Fix:
      Please investigate and resolve the internal mismatch that’s causing cancelOrder() to fail.

      Request:
      Kindly escalate this issue to the backend/API team. It affects automated risk management in live markets, where SLs must be cancellable in real-time.

      Thank you,
      Ranga

      posted in Python SDK
      R
      Ranga