placeOrder missing parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jkennard
    Junior Member
    • Nov 2019
    • 5

    #1

    placeOrder missing parameter

    Hi, having an issue with the placeOrder request. Here is my Json call
    {"jsonrpc": "2.0",
    "method": "SportsAPING/v1.0/placeOrders",
    "params": {"marketId": 1.170718570 ,
    "instructions":{"selectionId": 110503,
    "handicap": "0",
    "side": "BACK",
    "orderType": "LIMIT",
    "limitOrder": {"size": "2",
    "price": 1.1,
    "persistenceType": "LAPSE"}}},
    "id": 1}

    the response is
    {'jsonrpc': '2.0', 'error': {'code': -32602, 'message': 'DSC-0018'}, 'id': 1}

    the error code says
    MandatoryNotDefined Client 400 A parameter marked as mandatory was not provided
    Cant for life of me find the parameter. Seems identical to the visualistion code.
    Can anyone help?

  • WTPooh
    Member
    • May 2012
    • 88

    #2
    marketId is string.
    "marketId":"1.170718570"

    Comment

    • Jkennard
      Junior Member
      • Nov 2019
      • 5

      #3
      Thanks for the reply, I don't think thats it. Normally this field is occupied by a variable which is used in all the API calls. All the other calls work fine with this variable so I dont see why placeOrders would have an issue with it.

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        Nine times out of ten the marketId doesn't end in zero. If something somewhere treats it as numeric, a final zero can get lost. Safer to stick it in quotes anyway.

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          The instructions parameter is expecting an array. Put square brackets around them.
          Last edited by jabe; 12-06-2020, 04:54 PM.

          Comment

          • Jkennard
            Junior Member
            • Nov 2019
            • 5

            #6
            Originally posted by jabe View Post
            The instructions parameter is expecting an array. Put square brackets around them.
            Yes!!! Thank you so much.

            Comment

            Working...
            X