Canceling all Orders when 1 was requested

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OzPunter
    Junior Member
    • Apr 2009
    • 161

    #1

    Canceling all Orders when 1 was requested

    Hi,

    I place three bets and later request 1 to be cancelled, in this case 4424432127 in market2.101062934

    I send
    {"betId":"4424432127","marketId":"2.101062934","id ":"2","jsonrpc":"2.0"}

    but it cancels all three bets in the market, Why?

    The response I get back is:

    {"status":"SUCCESS","marketId":"2.101062934","inst ructionReports":
    [{"status":"SUCCESS","instruction":{"betId":"442443 2127"},"sizeCancelled":5.0},
    {"status":"SUCCESS","instruction":{"betId":"442443 2128"},"sizeCancelled":5.0},
    {"status":"SUCCESS","instruction":{"betId":"442443 2129"},"sizeCancelled":5.0}]}

    Kind Regards
    OzPunter
  • OzPunter
    Junior Member
    • Apr 2009
    • 161

    #2
    Can anyone give me an idea as to what is causing this.. need to get it sorted.

    Comment

    • OzPunter
      Junior Member
      • Apr 2009
      • 161

      #3
      Originally posted by OzPunter View Post
      Hi,

      I place three bets and later request 1 to be cancelled, in this case 4424432127 in market2.101062934

      I send
      {"betId":"4424432127","marketId":"2.101062934","id ":"2","jsonrpc":"2.0"}

      but it cancels all three bets in the market, Why?

      The response I get back is:

      {"status":"SUCCESS","marketId":"2.101062934","inst ructionReports":
      [{"status":"SUCCESS","instruction":{"betId":"442443 2127"},"sizeCancelled":5.0},
      {"status":"SUCCESS","instruction":{"betId":"442443 2128"},"sizeCancelled":5.0},
      {"status":"SUCCESS","instruction":{"betId":"442443 2129"},"sizeCancelled":5.0}]}

      Kind Regards
      OzPunter
      what exactly shoul I put in Cancel Orders for "sizeReduction"?

      I've tried NULL and null (like the manual says)and a blank and just gotten Bad Request as the response...

      What exactly is the correct string?

      Anyone..

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #4
        I think that if you want to set sizeReduction to null, then you can just leave it out of the json request.

        Out of interest, why is the id set to "2" in your request? Shouldn't this be "id":1 (i.e. both 1 and non-quoted)?

        Comment

        • gus
          Senior Member
          • Jan 2009
          • 134

          #5
          The betIds of the Bets that you want to cancel need to be in a List of Objects, and the parameter name of the list is "instructions".

          so, if I want to cancel a particular bet, my (REST)request looks like this:

          cancelOrders/{"marketId":"1.116317001","instructions":[{"betId":"43371250063"}]}

          and the response looks like this:

          {"marketId":"1.116317001","status":"SUCCESS","inst ructionReports":[{"status":"SUCCESS","instruction":{"betId":"433712 500
          63"},"sizeCancelled":2.0}]}

          in that request I want to cancel the entire bet, whatever size is remaining, so I'm not specifying a sizeReduction.

          with you request as it stands, I think the api is understanding the marketId part of your request, but not the betIds (because they're not properly in a List of instructions), so it thinks you want to cancel all Bets in the specified marketId.
          Last edited by gus; 11-11-2014, 04:12 PM. Reason: typo

          Comment

          • OzPunter
            Junior Member
            • Apr 2009
            • 161

            #6
            Originally posted by betdynamics View Post
            I think that if you want to set sizeReduction to null, then you can just leave it out of the json request.

            Out of interest, why is the id set to "2" in your request? Shouldn't this be "id":1 (i.e. both 1 and non-quoted)?
            Thank You BetDynamics,

            The "Id" part is a bit of a mystery to me I'm not sure what it's importances is.. In some of the examples it is "jsonrpc": "2.0",
            and in others there is "id":1

            I'm geting the two confused I think...

            Thanks
            OzPunter

            Comment

            • OzPunter
              Junior Member
              • Apr 2009
              • 161

              #7
              Yes BetDynamics,

              "id":1, is correct and tested OK, thankyou..

              "id:"1", and "id:"1, are both wrong and result in Bad Request

              Thanks Again

              OzPunter

              Comment

              • OzPunter
                Junior Member
                • Apr 2009
                • 161

                #8
                Originally posted by gus View Post
                The betIds of the Bets that you want to cancel need to be in a List of Objects, and the parameter name of the list is "instructions".

                so, if I want to cancel a particular bet, my (REST)request looks like this:

                cancelOrders/{"marketId":"1.116317001","instructions":[{"betId":"43371250063"}]}

                and the response looks like this:

                {"marketId":"1.116317001","status":"SUCCESS","inst ructionReports":[{"status":"SUCCESS","instruction":{"betId":"433712 500
                63"},"sizeCancelled":2.0}]}



                in that request I want to cancel the entire bet, whatever size is remaining, so I'm not specifying a sizeReduction.

                with you request as it stands, I think the api is understanding the marketId part of your request, but not the betIds (because they're not properly in a List of instructions), so it thinks you want to cancel all Bets in the specified marketId.
                Dear Gus,
                Thankyou, your correction works and is correct.

                Thanks again
                OzPunter

                Comment

                Working...
                X