...
Code Block | ||
---|---|---|
| ||
def placeBet(marketId, selectionId):
if( marketId is not None and selectionId is not None):
print 'Calling placeOrder for marketId :' + marketId + ' with selection id :' + str(selectionId)
place_order_Req = '{"marketId":"' + marketId + '","instructions":'\
'[{"selectionId":"' + str(
selectionId) + '","handicap":"0","side":"BACK","orderType":"LIMIT","limitOrder":{"size":"1.01","price":"1.50","persistenceType":"LAPSE"}}],"customerRef":"test12121212121"}'
endPoint = 'https://beta-api.betfair.com/rest/v1.0/placeOrders/'
place_order_Response = callAping(endPoint, place_order_Req)
place_order_load = json.loads(place_order_Response)
print 'Place order status is ' + place_order_load['status']
print 'Reason for Place order failure is ' + place_order_load['instructionReports'][0]['errorCode']
placeBet(marketid, runnerId) |
...