Go Back   Developer Program Forum > Sports API > API Services

API Services Discussion about the Sports Application Programming Interface (API) ,the platform on which participants in the Developers Program are able to build customised tools and interfaces to use with the Betfair (Sports) Exchange.

Post Reply
 
Thread Tools Display Modes
  #1  
Old 04-06-2012, 01:11 PM
Weeza Weeza is offline
Junior Member
 
Join Date: Apr 2012
Posts: 5
Default Updating the bet persistence of an existing unmatched bet

Using the UpdateBet function, I am able to update either the size or the price of an unmatched bet on a horse race. But I don't seem to be able the change the bet persistence of the bet. On the Betfair website there are 3 radio buttons that let you change the persistence quickly and easily. How can I change the persistence type of an existing unmatched bet?
  #2  
Old 04-06-2012, 01:31 PM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 520
Default

Quote:
Originally Posted by Weeza View Post
Using the UpdateBet function, I am able to update either the size or the price of an unmatched bet on a horse race. But I don't seem to be able the change the bet persistence of the bet. On the Betfair website there are 3 radio buttons that let you change the persistence quickly and easily. How can I change the persistence type of an existing unmatched bet?
There is no problem to change persistence of Bet. It works
  #3  
Old 04-06-2012, 01:35 PM
Weeza Weeza is offline
Junior Member
 
Join Date: Apr 2012
Posts: 5
Default

What parameters do I need to pass into the updateBet function to change the bet persistence type (and leave the size and price unchanged) ?
  #4  
Old 04-06-2012, 03:04 PM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 520
Default

Quote:
Originally Posted by Weeza View Post
What parameters do I need to pass into the updateBet function to change the bet persistence type (and leave the size and price unchanged) ?
Damn, just checked it

Code:
    updateBets : function(cb) {
        console.log('===== updateBets for betId=%s, change bet size =====',betId);
        var bet = {
                betId: betId,
                newBetPersistenceType: "NONE",
                newPrice : "1.01",
                newSize : "5.0",
                oldBetPersistenceType: "IP",
                oldPrice : "1.01",
                oldSize : "5.0"

        }
        var inv = session.updateBets([bet])
The result is extremely strange:
Code:
{ header: 
   { errorCode: 'OK',
     minorErrorCode: null,
     sessionToken: 'removed',
     timestamp: Fri, 06 Apr 2012 15:01:53 GMT },
  betResults: 
   [ { betId: '19209544488',
       newBetId: '0',
       sizeCancelled: '0.0',
       newSize: '0.0',
       newPrice: '0.0',
       resultCode: 'BET_IN_PROGRESS',
       success: 'false' } ],
  errorCode: 'BET_IN_PROGRESS',
  minorErrorCode: null }
It's certainly bug. The call is 5 sec although market is not in-play. Please contact Betfair Team to inform them, they are certainly have problems with backends
  #5  
Old 04-06-2012, 03:22 PM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 520
Default

It works now

Code:
{ header: 
   { errorCode: 'OK',
     minorErrorCode: null,
     sessionToken: 'removed',
     timestamp: Fri, 06 Apr 2012 15:19:46 GMT },
  betResults: 
   [ { betId: '19209925060',
       newBetId: '0',
       sizeCancelled: '0.0',
       newSize: '5.0',
       newPrice: '1.01',
       resultCode: 'PERSISTENCE_MODIFICATION_SUCCESS',
       success: 'true' } ],
  errorCode: 'OK',
  minorErrorCode: null }
  #6  
Old 04-07-2012, 03:13 AM
Weeza Weeza is offline
Junior Member
 
Join Date: Apr 2012
Posts: 5
Default

The parameters that you used was the first thing that I had originally tried. Then I tried various other combinations which didn't work either. I tried it again now and it is still not working.

This is what I sent:
<UpdateBets>
<betId>nnnnnnnnn</betId>
<NewBetPersistenceType>SP</NewBetPersistenceType>
<newPrice>1000</newPrice>
<newSize>5</newSize>
<oldBetPersistenceType>NONE</oldBetPersistenceType>
<oldPrice>1000</oldPrice>
<oldSize>5</oldSize>
</UpdateBets>

And this is what I got back:
<n2:UpdateBetsResult xsi:type="n2:UpdateBetsResult">
<betId xsi:type="xsd:long">nnnnnnnnnn</betId>
<newBetId xsi:type="xsd:long">0</newBetId>
<sizeCancelled xsi:type="xsd:double">0.0</sizeCancelled>
<newSize xsi:type="xsd:double">0.0</newSize>
<newPrice xsi:type="xsd:double">0.0</newPrice>
<resultCode xsi:type="n2:UpdateBetsResultEnum">INVALID_PRICE_A ND_SIZE</resultCode>
<success xsi:type="xsd:boolean">false</success>
</n2:UpdateBetsResult>


The documentation only talks about being able to change the price or the size. But the old persistence and new persistence are parameters to the UpdateBets function. Can you see anything different in what I have done compared to what you have done?
  #7  
Old 04-07-2012, 04:21 AM
Weeza Weeza is offline
Junior Member
 
Join Date: Apr 2012
Posts: 5
Default

Also, if I call UpdateBets and change the size up by 0.01 and have a NewPersistence which is different to the OldPersistence, then the bet still goes in with the OldPersistence.
  #8  
Old 04-07-2012, 04:26 AM
Weeza Weeza is offline
Junior Member
 
Join Date: Apr 2012
Posts: 5
Default

I have figured out what I was doing incorrectly.

The tag for NewBetPersistence type needed to be newBetPersistenceType. For all the other tags I correctly had a lower case letter to start with, but unfortunately I had put a capital N instead of a lower case n on newBetPersistenceType.

It is all working correctly now.

Thanks for your help AlgoTrader.
Post Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 04:35 PM.


BETFAIR® and the BETFAIR LOGO are registered trade marks of The Sporting Exchange Limited. Data on Betfair website(s) (including pricing data) is protected by © and database rights. It may not be used for any purpose without a licence. © The Sporting Exchange Limited. All rights reserved.