Always getting INVALID_RUNNER errors when trying to place_orders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kiwicricket
    Junior Member
    • Feb 2019
    • 5

    #1

    Always getting INVALID_RUNNER errors when trying to place_orders

    I am trying to test making a bet with the API, but i always get an INVALID_RUNNER error. i have tried changing the selection criteria for selecting a selectionId and bet prices. I have even tried inspecting the element in website to hard code, selectionID and price (to confirm the runners were valid, especially with my delayed feed from betfair) but i always get the below error.

    The selectionId is an instance of a int and price is float.

    {'instructions': [{'limitOrder': {'size': 4, 'persistenceType': 'PERSIST', 'price': 1.23}, 'side': 'BACK', 'selectionId': 5067518, 'orderType': 'LIMIT'}], 'marketId': '1.154594984'}

    ({'jsonrpc': '2.0', 'result': {'status': 'FAILURE', 'errorCode': 'BET_ACTION_ERROR', 'marketId': '1.154594984', 'instructionReports': [{'status': 'FAILURE', 'errorCode': 'INVALID_RUNNER', 'instruction': {'selectionId': 5067518, 'limitOrder': {'size': 4.0, 'price': 1.23, 'persistenceType': 'PERSIST'}, 'orderType': 'LIMIT', 'side': 'BACK'}}]}, 'id': 1}, 1.98132)

    Any suggestions? I assume the error is returned for other reasons other than because the bet contained an INVALID_RUNNER.

    kiwicricket

  • kiwicricket
    Junior Member
    • Feb 2019
    • 5

    #2
    If it helps, this is what i am preparing to send:

    SportsAPING/v1.0/listMarketBook {'priceProjection': {'rolloverStakes': False, 'virtualise': True, 'exBestOffersOverrides': {}, 'priceData': ['EX_BEST_OFFERS']}, 'marketIds': ['1.154655109']}
    Selection ID Type <class 'int'>
    price type <class 'float'>
    market id type <class 'str'>
    Selection Ids Name 175 Runs or more
    Selection Id 269569
    Price 1.27
    269569

    json message and response:

    SportsAPING/v1.0/placeOrders {'instructions': [{'limitOrder': {'size': 5.0, 'persistenceType': 'LAPSE', 'price': 1.27}, 'side': 'LAY', 'selectionId': 269569, 'orderType': 'LIMIT'}], 'marketId': '1.154655109'}
    ({'jsonrpc': '2.0', 'result': {'status': 'FAILURE', 'errorCode': 'BET_ACTION_ERROR', 'marketId': '1.154655109', 'instructionReports': [{'status': 'FAILURE', 'errorCode': 'INVALID_RUNNER', 'instruction': {'selectionId': 269569, 'limitOrder': {'size': 5.0, 'price': 1.27, 'persistenceType': 'LAPSE'}, 'orderType': 'LIMIT', 'side': 'LAY'}}]}, 'id': 1}, 1.617197)

    Comment

    • kiwicricket
      Junior Member
      • Feb 2019
      • 5

      #3
      got an answer from a slack channel, if anyone else is having the same issue, works like a dream now!


      `handicap` - https://docs.developer.betfair.com/d...aceInstruction

      handicap double - The handicap associated with the runner in case of Asian handicap markets (e.g. marketTypes ASIAN_HANDICAP_DOUBLE_LINE, ASIAN_HANDICAP_SINGLE_LINE) null otherwise.

      when looking at the "definition" of that market, https://www.betfair.com/www/sports/e...ER_DESCRIPTION

      the market is a `ASIAN_HANDICAP_SINGLE_LINE`, and the runner you were looking to put a bet on has, via the API, a handicap of `-175`
      you needed to include that in your `placeOrders` instruction

      Comment

      Working...
      X