Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
bgColor#FFFFFF
titleBGColor#C8D0E4
titleplaceOrders
PlaceExecutionReport placeOrders ( StringmarketId , List< PlaceInstruction >instructions, String customerRef, MarketVersion marketVersion, String customerStrategyRef ) throws APINGException

Place new orders into market. This operation is atomic in that all orders will be placed or none will be placed. Please note that additional bet sizing rules apply to bets placed into the Italian Exchange.

Parameter name

Type

Required

Description

marketId

String

(tick)

The market id these orders are to be placed on

instructions

List< PlaceInstruction >

(tick)

The number of place instructions.  The limit of place instructions per request is 200 for the UK/AUS Exchange and 50 for the Italian Exchange.

customerRef

String

 

Optional parameter allowing the client to pass a unique string (up to 32 chars) that is used to de-dupe mistaken re-submissions.   CustomerRef can contain: upper/lower chars, digits, chars : - . _ + * : ; ~ only. Please note: There is a time window associated with the de-duplication of duplicate submissions which is 60 seconds.

marketVersion

MarketVersion

 

Optional parameter allowing the client to specify which version of the market the 
orders should be placed on. If the current market version is higher than that sent on an order, 
the bet will be lapsed.

customerStrategyRef

String

 

An optional reference customers can use to specify which strategy has sent the order. 
The reference will be returned on order change messages through the stream API. The string is 
limited to 15 characters. If an empty string is provided it will be treated as null.

Return type

Description

PlaceExecutionReport

 

Throws

Description

APINGException

Generic exception that is thrown if this operation fails for any reason.

Since 1.0.0

Placing a Bet

To place a bet you require the marketId and selectionId parameters from the listMarketCatalogue API call. The below parameters will place a normal Exchange bet at odds of 3.0 for a stake of £2.0.

If the bet is placed successfully, a betId is returned in the placeOrders response

placeOrders Request

 

[
    {
        "jsonrpc""2.0",
        "method""SportsAPING/v1.0/placeOrders",
        "params": {
            "marketId""1.109850906",
            "instructions": [
                {
                    "selectionId""237486",
                    "handicap""0",
                    "side""LAY",
                    "orderType""LIMIT",
                    "limitOrder": {
                        "size""2",
                        "price""3",
                        "persistenceType""LAPSE"
                    }
                }
            ]
        },
        "id"1
    }
]

 

placeOrder Response

 

[
    {
        "jsonrpc""2.0",
        "result": {
            "marketId""1.109850906",
            "instructionReports": [
                {
                    "instruction": {
                        "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
    }
]

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""2013-11-12T12:07:29.000Z",
                    "status""SUCCESS"
                }
            ],
            "status""SUCCESS"
        },
        "id"1
    }
]

 


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.

...