cancelOrders why are all bets being cancelled?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • onix250
    replied
    Specifying betID without marketID results in Exception (wrong input data or something like that)

    Is a bit frustrating, make two cals just to cancel two bets on different markets

    and in API 6 there was a limit for costless transational operations

    Leave a comment:


  • molnarlac
    replied
    Yes, I checked the my code, and I discovered the error.
    I placed the json string of $params into the request object, not the $params object. And now ... works it.

    Leave a comment:


  • betdynamics
    replied
    Post the actual JSON string that is being sent to the server rather than the code used to generate it.

    It will look something like:

    Code:
    {"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":"1.116526412","instructions":[{"betId":"43950294170","sizeReduction":2.0}],"customerRef":"1234"},"id":1}

    Leave a comment:


  • molnarlac
    replied
    Currently is the code:

    $params = array(
    "marketId" => $marketId ,
    "betId" => array( $betId ) ,
    "customerRef" => round( time() / 3 )
    );

    $cancelOrders = sportsApingRequest( $appKey , $sessionToken , 'cancelOrders' , json_encode( $params ) );


    The sportsApingRequest function is cut and copy from betfair sample code.
    I think that the error is with setting of marketId. I change the $betId to string or place into an instructions object, and single data or in array. Wrong-wrong-wrong.

    Leave a comment:


  • betdynamics
    replied
    Post the actual JSON request rather than the code - that will make it easier to spot the problem (hopefully)

    Leave a comment:


  • molnarlac
    replied
    Hello,

    same problem
    I wrote to my code (php)
    $params = [
    array(
    "marketId" => $marketId , // $marketId is a string!
    "betId" => $betId // $betId - string or long or string-array or long-array
    )
    ]
    OR
    $params=[
    array(
    "marketId" => $marketId ,
    "instructions" => [ { "betId" => $betId ( string or long ) } , {} ]
    )
    ]
    And I tried all in other possible combination.
    The cancelOrders is cancelled all orders all in case.
    What make I wrong?

    Leave a comment:


  • betdynamics
    replied
    A quick play around with the visualiser SUGGESTS that as soon as you specify a betId, then you also have to specify a marketId in order for the call to be accepted.

    So, that would suggest it is not possible to place a cancelOrder call with just betIds specified and no marketId.

    However, that is NOT a definitive answer. To get that, I suggest that you email the BDP team then - bdp@betfair.com - and ask them directly.
    Last edited by betdynamics; 04-11-2014, 04:28 PM.

    Leave a comment:


  • arteny1
    replied
    Originally posted by betdynamics View Post
    I don't know the answer although I suspect that it will only cancel those bets whose betId has been specified.

    However, surely it is not difficult to test?

    Just pick a quiet time, put 3 or 4 bets on to the market at odds that won't be matched and then cancel some. Then see if all of the bets have been cancelled or just the ones that you specified.
    I can't do this, because I can't allow to cancel all bets on all markets.

    Leave a comment:


  • betdynamics
    replied
    I don't know the answer although I suspect that it will only cancel those bets whose betId has been specified.

    However, surely it is not difficult to test?

    Just pick a quiet time, put 3 or 4 bets on to the market at odds that won't be matched and then cancel some. Then see if all of the bets have been cancelled or just the ones that you specified.

    Leave a comment:


  • arteny1
    replied
    Please answer

    So, can anybody answer my question?
    If marketId is not supplied, but bet id's are supplied (for one market) - will those instruction be executed?

    Leave a comment:


  • arteny1
    replied
    Originally posted by Betfair Developers Program View Post
    Hi arteny1.

    Yes, submitting:

    Code:
    [{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/cancelOrders", "params": {}, "id": 1}]
    Will cancel all unmatched bets on all markets.

    Kind Regards

    Neil
    @Neil, sorry for misunderstanding, but I asked about a different case.
    In your case instuctions are empty, I am asking about case, when market id is not specified, but instructions is list of instructions with bet ids specified.
    So in this case all bets from all markets are canceled or only bets with specified id's in instructins will be canceled?

    Leave a comment:


  • BetfairDeveloperProgram
    replied
    Hi arteny1.

    Yes, submitting:

    Code:
    [{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/cancelOrders", "params": {}, "id": 1}]
    Will cancel all unmatched bets on all markets.

    Kind Regards

    Neil

    Leave a comment:


  • arteny1
    replied
    Are all markets all bets are canceled?

    Docmuentation says:
    marketId
    String
    If not supplied all bets are cancelled

    My question is in this case (when marketId is not supplied) all bets from instructions are cancelled or every bet on all markets will be canceled (it looks too dangerous, necessary bets can be canceled)?

    Leave a comment:


  • Intrepid
    replied
    brilliant, many thanks

    Leave a comment:


  • jim tollan
    replied
    hi there, you also need to quote the MarketId when cancelling. So using the approach that you use, your json would look something like:

    " [{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/cancelOrders"", ""params"": {""betId"":" & myBetId & ", ""MarketId"":" & betMarketId & ",""id"": 1}}]"

    Leave a comment:

Working...
X