Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    insert variable in payload

    Python SDK
    2
    4
    25
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      panda1234 last edited by

      price=14900
      payload = "{\n"exchange": "NFO",\n"triggerprice": "price",\n"tradingsymbol": "NIFTY25FEB21FUT",\n"quantity": 4,\n "symboltoken": "60530",\n "duration": "DAY",\n"disclosedquantity": 0,\n"transactiontype": "BUY",\n"ordertype": "STOPLOSS_MARKET",\n"variety": "STOPLOSS",\n"producttype": "CARRYFORWARD"\n}"

      how to put variable "price" inside "payload parameter"

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @panda1234 last edited by

        Hi @panda1234 , use below request body to place stop loss orders

        {"exchange": "NFO", "tradingsymbol": "NIFTY25FEB21FUT", "quantity": 75, "transactiontype": "BUY", "ordertype": "STOPLOSS_MARKET", "variety": "STOPLOSS", "producttype": "CARRYFORWARD", "price": 0, "triggerprice": 14900,"symboltoken": "60530","duration":"DAY"}

        P 1 Reply Last reply Reply Quote 0
        • P
          panda1234 @admin last edited by

          @admin it shows one error:
          TypeError: can't concat str to bytes

          P 1 Reply Last reply Reply Quote 0
          • P
            panda1234 @panda1234 last edited by

            @panda1234 problem solved
            thank you

            1 Reply Last reply Reply Quote 0
            • First post
              Last post