I'm getting the following errors logged when trying to submit a LAY bet on the favourite. PYTHON script.
2025-07-05 22:00:13,023 ERROR: API Error during bet placement: SportsAPING/v1.0/placeOrders
Params: {'marketId': '1.245357366', 'instructions': [{'orderType': 'LIMIT', 'selectionId': 81280945, 'side': 'LAY', 'limitOnCloseOrder': {'size': 1.52, 'price': 1.01}, 'persistenceType': 'LAPSE', 'customerRef': 'bsp_lay_1.245357366_81280945'}], 'marketVersion': {'version': 6727062778}}
Exception: None
Error: {'code': -32602, 'message': 'DSC-0018'}
Full Response: {'jsonrpc': '2.0', 'error': {'code': -32602, 'message': 'DSC-0018'}, 'id': 1}
2025-07-05 22:00:13,024 ERROR: Full Betfair API Response: {
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "DSC-0018"
},
"id": 1
}
2025-07-05 22:00:13,024 ERROR: Error during bet placement: name 'betfair_api' is not defined
It's a solid error, I get it every time I attempt a submission.
Here's my submission bit of the code:
# Try placing the bet
latest_book = client.betting.list_market_book([market_id])[0]
market_version = {'version': latest_book.version}
place_resp = client.betting.place_orders(
market_id=market_id,
instructions=[{
'orderType':"LIMIT",
'selectionId':fav_id,
'side':"LAY",
'limitOnCloseOrder': {
'size':stake,
'price':1.01 #comment
},
'persistenceType':"LAPSE", # LAPSE, IOC, etc.
'customerRef': f'bsp_lay_{market_id}_{fav_id}'
}],
market_version=market_version
)
It's lost its indentation in translation, but hopefully this gives the gereral idea. I've been trying all sorts of combinations of parameters etc but it has successfully submittted two LAY bets on one iteration, but unfortunately that was early in my testing process and I didn't realise how significant it was and over wrote it before securing the details.
I was a total newbie to this last week, now its taken over my life. So bear with me if its something obvious.
2025-07-05 22:00:13,023 ERROR: API Error during bet placement: SportsAPING/v1.0/placeOrders
Params: {'marketId': '1.245357366', 'instructions': [{'orderType': 'LIMIT', 'selectionId': 81280945, 'side': 'LAY', 'limitOnCloseOrder': {'size': 1.52, 'price': 1.01}, 'persistenceType': 'LAPSE', 'customerRef': 'bsp_lay_1.245357366_81280945'}], 'marketVersion': {'version': 6727062778}}
Exception: None
Error: {'code': -32602, 'message': 'DSC-0018'}
Full Response: {'jsonrpc': '2.0', 'error': {'code': -32602, 'message': 'DSC-0018'}, 'id': 1}
2025-07-05 22:00:13,024 ERROR: Full Betfair API Response: {
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "DSC-0018"
},
"id": 1
}
2025-07-05 22:00:13,024 ERROR: Error during bet placement: name 'betfair_api' is not defined
It's a solid error, I get it every time I attempt a submission.
Here's my submission bit of the code:
# Try placing the bet
latest_book = client.betting.list_market_book([market_id])[0]
market_version = {'version': latest_book.version}
place_resp = client.betting.place_orders(
market_id=market_id,
instructions=[{
'orderType':"LIMIT",
'selectionId':fav_id,
'side':"LAY",
'limitOnCloseOrder': {
'size':stake,
'price':1.01 #comment
},
'persistenceType':"LAPSE", # LAPSE, IOC, etc.
'customerRef': f'bsp_lay_{market_id}_{fav_id}'
}],
market_version=market_version
)
It's lost its indentation in translation, but hopefully this gives the gereral idea. I've been trying all sorts of combinations of parameters etc but it has successfully submittted two LAY bets on one iteration, but unfortunately that was early in my testing process and I didn't realise how significant it was and over wrote it before securing the details.
I was a total newbie to this last week, now its taken over my life. So bear with me if its something obvious.


Comment