Navigation

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

    sell order not posted

    General Discussion
    3
    14
    91
    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.
    • V
      Ved @admin last edited by

      @admin this is my code :

      <?php
      include "connect.php";
      $jwtselect = mysqli_fetch_assoc(mysqli_query($connection,"select * from token where id ='1'"));
      $feedjwt = $jwtselect['feed'];
      $tradejwt = $jwtselect['trade'];
      $historyjwt = $jwtselect['history'];
      $au="Authorization:Bearer ";
      $feedjwtt = "Authorization:Bearer "." ".$feedjwt;

      $feedheaders = array('Authorization:Bearer '.$feedjwt,'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 208.91.198.55', 'X-ClientPublicIP: 43.225.3.40', 'X-MACAddress: 20-E6-17-07-19-3F', 'X-PrivateKey: secretkey');
      $tradeheaders = array('Authorization:Bearer '.$tradejwt,'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 208.91.198.55', 'X-ClientPublicIP: 43.225.3.40', 'X-MACAddress: 20-E6-17-07-19-3F', 'X-PrivateKey: secretkey');
      $historyheaders = array($historyjwt,'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 208.91.198.55', 'X-ClientPublicIP: 43.225.3.40', 'X-MACAddress: 20-E6-17-07-19-3F', 'X-PrivateKey: secretkey');

      $data["exchange"] = "NSE";
      $data["tradingsymbol"] = "HTMEDIA-EQ";
      $data["symboltoken"] = "11979";
      $data["transactiontype"] = "SELL";
      $data["ordertype"] = "LIMIT";
      $data["price"] = "40.0";
      $data["quantity"] = "1";
      $data["disclosedquantity"] = "0";
      $data["variety"] = "NORMAL";
      $data["producttype"] = "DELIVERY";
      $data["duration"] = "DAY";

      $url = 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder';

      $jsonData = json_encode($data);

      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $url);

      curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
      curl_setopt($curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $tradeheaders);

      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

      $result = curl_exec($curl);
      $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

      echo '<br/>Response Status : ' . $http_status;
      echo '<br/>Response String : ' . $result;

      //To Convert json response to array
      //$resJsonArray = json_decode($responseContent, true);
      $resJsonArray = json_decode($result, true);
      $mms = $resJsonArray['message'];
      echo " mms ".$mms;
      print_r($result);

      ?>

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

        Hi @aksharmty we have noticed your request we will revert you back on this.

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

          hi @aksharmty Are you able to place the sell order now.

          V 1 Reply Last reply Reply Quote 0
          • V
            Ved @admin last edited by

            @admin I am try again and again but order not posted on exchange.
            Are you write me what requirment for posting order on exchange using your API?

            A D 2 Replies Last reply Reply Quote 0
            • A
              admin @Ved last edited by

              HI @aksharmty Let us know which type of order you want to execute we will send you the request for the same.

              V 1 Reply Last reply Reply Quote 0
              • V
                Ved @admin last edited by

                @admin I have htmedia-eq in my demat . Now I want post sell order for delivery .
                $data["exchange"] = "NSE";
                $data["tradingsymbol"] = "HTMEDIA-EQ";
                $data["symboltoken"] = "11979";
                $data["transactiontype"] = "SELL";
                $data["ordertype"] = "LIMIT";
                $data["price"] = "40.0";
                $data["quantity"] = "1";
                $data["disclosedquantity"] = "0";
                $data["variety"] = "NORMAL";
                $data["producttype"] = "DELIVERY";

                1 Reply Last reply Reply Quote 0
                • D
                  darshan @Ved last edited by

                  @aksharmty Hi, Did your order post on exchange? I am facing the same issue. Sell order is not showing in exchange/site/UI.

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

                    Hi @darshan Post your request and response here.

                    D 2 Replies Last reply Reply Quote 0
                    • D
                      darshan @admin last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • D
                        darshan @admin last edited by

                        @admin Thank you so much Yatish for your help. It is working now.

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