...
If the bet is placed successfully, a betId is returned in the placeOrders response
placeOrders Request
{
"SportsAPING/v1.0/placeOrders", |
{
[
{
"handicap"
:
"0"
,
{
"price"
:
"3"
,
"price": "3",
"persistenceType": |
"LAPSE"
}
}
]
},
"id"
:
1
}
"LAPSE"
}
}
]
},
"id": 1
}
] |
placeOrder Response
[
{
{
"instructionReports"
: [
{
"instructionReports": [
{
"instruction": |
{
"selectionId"
:
237486
,
{
"selectionId": 237486,
"handicap": |
0
,
"limitOrder"
: {
"size"
:
2
,
"price"
:
3
,
"persistenceType"
:
"LAPSE"
},
"orderType"
:
"LIMIT"
,
"side"
:
"LAY"
},
"betId"
:
"31242604945"
,
"placedDate"
:
"2013-10-30T14:22:47.000Z"
,
"averagePriceMatched"
:
0
,
"sizeMatched"
:
0
,
"status"
:
"SUCCESS"
}
],
"status"
:
"SUCCESS"
},
"id"
:
1
}
]
0,
"limitOrder": {
"size": 2,
"price": 3,
"persistenceType": "LAPSE"
},
"orderType": "LIMIT",
"side": "LAY"
},
"betId": "31242604945",
"placedDate": "2013-10-30T14:22:47.000Z",
"averagePriceMatched": 0,
"sizeMatched": 0,
"status": "SUCCESS"
}
],
"status": "SUCCESS"
},
"id": 1
}
]
|
Placing a Betfair SP Bet
To place a bet on a selection at Betfair SP, you need to specify the parameters below in the placeOrders request. The below example would place a Betfair SP back bet on the required selection for a stake of £2.00.
Request
placeOrders Request
[
{
"jsonrpc" : "2.0" ,
"method" : "SportsAPING/v1.0/placeOrders" ,
"params" : {
"marketId" : "1.111836557" ,
"instructions" : [
{
"selectionId" : "5404312" ,
"handicap" : "0" ,
"side" : "BACK" ,
"orderType" : "MARKET_ON_CLOSE" ,
"marketOnCloseOrder" : {
"liability" : "2"
}
}
]
},
"id" : 1
}
]
|
placeOrders Response
[
{
"jsonrpc"
:
"2.0"
,
"result"
: {
"marketId"
:
"1.111836557"
,
"instructionReports"
: [
{
"instruction"
: {
"selectionId"
:
5404312
,
"handicap"
:
0
,
"marketOnCloseOrder"
: {
"liability"
:
2
},
"orderType"
:
"MARKET_ON_CLOSE"
,
"side"
:
"BACK"
},
"betId"
:
"31645233727"
,
"placedDate"
:
Code Block |
---|
[
{
"jsonrpc": "2.0",
"method": "SportsAPING/v1.0/placeOrders",
"params": {
"marketId": "1.111836557",
"instructions": [
{
"selectionId": "5404312",
"handicap": "0",
"side": "BACK",
"orderType": "MARKET_ON_CLOSE",
"marketOnCloseOrder": {
"liability": "2"
}
}
]
},
"id": 1
}
]
|
placeOrders Response
Code Block |
---|
[
{
"jsonrpc": "2.0",
"result": {
"marketId": "1.111836557",
"instructionReports": [
{
"instruction": {
"selectionId": 5404312,
"handicap": 0,
"marketOnCloseOrder": {
"liability": 2
},
"orderType": "MARKET_ON_CLOSE",
"side": "BACK"
},
"betId": "31645233727",
"placedDate": "2013-11-12T12:07:29.000Z", |
...
...
...
}
],
...
...
...
},
...
...
}
]
...
Fill or Kill bets
By setting the optional parameter ‘TimeInForce’ on a limitOrder submission to the value ‘FILL_OR_KILL’ and optionally passing a minFillSize value, the Exchange will only match the order if at least the specified minFillSize can be matched (if passed) or the whole order matched (if not). Any order which cannot be so matched, and any remaining unmatched part of the order (if minFillSize is specified) will be immediately cancelled.
...