Versions Compared

Key

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

Type Definitions

...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleStartingPrices

Information about the Betfair Starting Price. Only available in BSP markets

Field name

Type

Required

Description

nearPrice

double


What the starting price would be if the market was reconciled now taking into account the SP bets as well as unmatched exchange bets on the same selection in the exchange. This data is cached and update every 60 seconds. Please note: Type Double may contain numbers, INF, -INF, and NaN.

farPrice

double


What the starting price would be if the market was reconciled now taking into account only the currently place SP bets. The Far Price is not as complicated but not as accurate and only accounts for money on the exchange at SP. This data is cached and updated every 60 seconds. Please note: Type Double may contain numbers, INF, -INF, and NaN.

backStakeTaken

List<#PriceSize >


The total amount of back bets matched at the actual Betfair Starting Price. Pre-reconciliation, this field is zero for all prices except 1.01 (for Market on Close bets) and at the limit price for any Limit on Close bets.

layLiabilityTaken

List< PriceSize >


The lay amount matched at the actual Betfair Starting Price. Pre-reconciliation, this field is zero for all prices except 1000 (for Market on Close bets) and at the limit price for any Limit on Close bets.

actualSP

double


The final BSP price for this runner. Only available for a BSP market that has been reconciled. Please note: for REMOVED runners the actualSP will be returned as 'NaN. Value may be returned as 'Infinity' if no BSP can be calculated.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleClearedOrderSummary

 Summary of a cleared order.

Field name

Type

Required

Description

eventTypeId

Betting Type Definitions#EventTypeIdEventTypeId


The id of the event type bet on. Available at EVENT_TYPE groupBy level or lower.

eventId

Betting Type Definitions#EventIdEventId


The id of the event bet on. Available at EVENT groupBy level or lower.

marketId

Betting Type Definitions#MarketIdMarketId


The id of the market bet on. Available at MARKET groupBy level or lower.

selectionId

Betting Type Definitions#SelectionIdSelectionId


The id of the selection bet on. Available at RUNNER groupBy level or lower.

handicap

Betting Type Definitions#HandicapHandicap


The handicap.  Enter the specific handicap value (returned by RUNNER in listMaketBook) if the market is an Asian handicap market. Available at MARKET groupBy level or lower.

betId

BetId


The id of the bet. Available at BET groupBy level.

placedDate

Date


The date the bet order was placed by the customer. Only available at BET groupBy level.

persistenceType

PersistenceType


The turn in play persistence state of the order at bet placement time. This field will be empty or omitted on true SP bets. Only available at BET groupBy level.

orderType

OrderType


The type of bet (e.g standard limited-liability Exchange bet (LIMIT), a standard BSP bet (MARKET_ON_CLOSE), or a minimum-accepted-price BSP bet (LIMIT_ON_CLOSE)). If the bet has a OrderType of MARKET_ON_CLOSE and a persistenceType of MARKET_ON_CLOSE then it is a bet which has transitioned from LIMIT to MARKET_ON_CLOSE. Only available at BET groupBy level.

side

Side


Whether the bet was a back or lay bet. Available at SIDE groupBy level or lower.

itemDescription

Betting Type Definitions#ItemDescriptionItemDescription


A container for all the ancillary data and localised text valid for this Item

betOutcome

String


The settlement outcome of the bet. Tri-state (WIN/LOSE/PLACE) to account for Each Way bets where the place portion of the bet won but the win portion lost. The profit/loss amount in this case could be positive or negative depending on the price matched at. Only available at BET groupBy level.

priceRequested

Betting Type Definitions#PricePrice


The average requested price across all settled bet orders under this Item. Available at SIDE groupBy level or lower. For LINE markets this is the line position requested. For LINE markets this is the line position requested. 

settledDate

Date


The date and time the bet order was settled by Betfair. Available at SIDE groupBy level or lower.

lastMatchedDate

Date


The date and time the last bet order was matched by Betfair. Available on Settled orders only.

betCount

int


The number of actual bets within this grouping (will be 1 for BET groupBy)

commission

Size


The cumulative amount of commission paid by the customer across all bets under this Item, in the account currency. Available at EXCHANGE, EVENT_TYPE, EVENT and MARKET level groupings only.

priceMatched

Betting Type Definitions#PricePrice


The average matched price across all settled bets or bet fragments under this Item. Available at SIDE groupBy level or lower. For LINE markets this is the line position matched at. 

priceReduced

boolean


If true, then the matched price was affected by a reduction factor due to of a runner removal from this Horse Racing market.

sizeSettled

Betting Type Definitions#SizeSize


The cumulative bet size that was settled as matched or voided under this Item, in the account currency. Available at SIDE groupBy level or lower.

profit

Betting Type Definitions#SizeSize


The profit or loss (negative profit) gained on this line, in the account currency

sizeCancelled

Betting Type Definitions#SizeSize


The amount of the bet that was available to be matched, before cancellation or lapsing, in the account currency

customerOrderRef

String


The order reference defined by the customer for the bet order

customerStrategyRef

String


The strategy reference defined by the customer for the bet order


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleClearedOrderSummaryReport

A container representing search results.

Field name

Type

Required

Description

clearedOrders

List<Betting Type Definitions#ClearedOrderSummaryClearedOrderSummary>

(tick)

The list of cleared orders returned by your query. This will be a valid list (i.e. empty or non-empty but never 'null').

moreAvailable

boolean

(tick)

Indicates whether there are further result items beyond this page. Note that underlying data is highly time-dependent and the subsequent search orders query might return an empty result.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleCurrentItemDescription

CurrentItemDescription

This object contains ancillary information about the item

Field name

Type

Required

Description

marketVersion

Betting Type Definitions#MarketVersionMarketVersion


The relevant version of the market for this item


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleRunnerId

This object contains the unique identifier for a runner

Field name

Type

Required

Description

marketId

MarketId

The id of the market bet on

selectionId

SelectionId

The id of the selection bet on

handicap

Betting Type Definitions#HandicapHandicap


The handicap associated with the runner in case of asian handicap markets, otherwise returns '0.0'.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleCurrentOrderSummaryReport

A container representing search results.

Field name

Type

Required

Description

currentOrders

List< Betting Type Definitions#CurrentOrderSummary CurrentOrderSummary >

(tick)

The list of current orders returned by your query. This will be a valid list (i.e. empty or non-empty but never 'null').

moreAvailable

boolean

(tick)

Indicates whether there are further result items beyond this page. Note that underlying data is highly time-dependent and the subsequent search orders query might return an empty result.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleCurrentOrderSummary

Summary of a current order.

Field name

Type

Required

Description

betId

String

(tick)

The bet ID of the original place order.

marketId

String

(tick)

The market id the order is for.

selectionId

long

(tick)

The selection id the order is for.

handicap

double

(tick)

The handicap associated with the runner in case of Asian handicap markets, null otherwise.

priceSize

Betting Type Definitions#PriceSizePriceSize

(tick)

The price and size of the bet.

bspLiability

double

(tick)

Not to be confused with size. This is the liability of a given BSP bet.

side

Side

(tick)

BACK/LAY

status

OrderStatus

(tick)

Either EXECUTABLE (an unmatched amount remains) or EXECUTION_COMPLETE (no unmatched amount remains).

persistenceType

PersistenceType

(tick)

What to do with the order at turn-in-play.

orderType

OrderType

(tick)

BSP Order type.

placedDate

Date

(tick)

The date, to the second, the bet was placed.

matchedDate

Date

(tick)

The date, to the second, of the last matched bet fragment (where applicable)

averagePriceMatched

double


The average price matched at. Voided match fragments are removed from this average calculation. The price is automatically adjusted in the event of non runners being declared with applicable reduction factors. Please note: This value is not meaningful for activity on LINE markets and is not guaranteed to be returned or maintained for these markets. 

sizeMatched

double


The current amount of this bet that was matched.

sizeRemaining

double


The current amount of this bet that is unmatched.

sizeLapsed

double


The current amount of this bet that was lapsed.

sizeCancelled

double


The current amount of this bet that was cancelled.

sizeVoided

double


The current amount of this bet that was voided.

regulatorAuthCode

String


The regulator authorisation code.

regulatorCode

String


The regulator Code.

customerOrderRef

String


The order reference defined by the customer for this bet

customerStrategyRef

String


The strategy reference defined by the customer for this bet

currentItemDescription

Betting Type Definitions#CurrentItemDescriptionCurrentItemDescription


A container for all the ancillary data for this Item


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titlePlaceInstruction

Instruction to place a new order

Field name

Type

Required

Description

orderType

OrderType

(tick)


selectionId

long

(tick)

The selection_id.

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.

side

Side

(tick)

Back or Lay

limitOrder

Betting Type Definitions#LimitOrderLimitOrder


A simple exchange bet for immediate execution

limitOnCloseOrder

Betting Type Definitions#LimitOnCloseOrderLimitOnCloseOrder


Bets are matched if, and only if, the returned starting price is better than a specified price. In the case of back bets, LOC bets are matched if the calculated starting price is greater than the specified price. In the case of lay bets, LOC bets are matched if the starting price is less than the specified price. If the specified limit is equal to the starting price, then it may be matched, partially matched, or may not be matched at all, depending on how much is needed to balance all bets against each other (MOC, LOC and normal exchange bets)

marketOnCloseOrder

Betting Type Definitions#MarketOnCloseOrderMarketOnCloseOrder


Bets remain unmatched until the market is reconciled. They are matched and settled at a price that is representative of the market at the point the market is turned in-play. The market is reconciled to find a starting price and MOC bets are settled at whatever starting price is returned. MOC bets are always matched and settled, unless a starting price is not available for the selection. Market on Close bets can only be placed before the starting price is determined

customerOrderRef

String


An optional reference customers can set to identify instructions.. No validation will be done on uniqueness and the string is limited 
to 32 characters. If an empty string is provided it will be treated as null.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titlePlaceExecutionReport


Field name

Type

Required

Description

customerRef

String


Echo of the customerRef if passed.

status

ExecutionReportStatus

(tick)


errorCode

ExecutionReportErrorCode



marketId

String


Echo of marketId passed

instructionReports

List< Betting Type Definitions#PlaceInstructionReport PlaceInstructionReport >





Anchor
LimitOrder
LimitOrder

...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titlePlaceInstructionReport

Response to a PlaceInstruction

Field name

Type

Required

Description

status

InstructionReportStatus

(tick)

Whether the command succeeded or failed

errorCode

InstructionReportErrorCode


Cause of failure, or null if the command succeeds

orderStatus

OrderStatus


The status of the order, if the instruction succeeded. If the instruction is unsuccessful, no value is provided.  
Please note:  by default, this field is not returned for MARKET_ON_CLOSE and LIMIT_ON_CLOSE orders.

instruction

Betting Type Definitions#PlaceInstructionPlaceInstruction

(tick)

The instruction that was requested

betId

String


The bet ID of the new bet. Will be null on failure or if the order was placed asynchronously.

placedDate

Date


Will be null if the order was placed asynchronously

averagePriceMatched

Price


Will be null if the order was placed asynchronously. This value is not meaningful for activity on LINE markets and is not guaranteed to be returned or maintained for these markets. 

sizeMatched

Size


Will be null if the order was placed asynchronously


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleCancelExecutionReport


Field name

Type

Required

Description

customerRef

String


Echo of the customerRef if passed.

status

ExecutionReportStatus

(tick)


errorCode

ExecutionReportErrorCode



marketId

String


Echo of marketId passed

instructionReports

List< Betting Type Definitions#CancelInstructionReport CancelInstructionReport >





Anchor
ReplaceInstruction
ReplaceInstruction

...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleReplaceExecutionReport


Field name

Type

Required

Description

customerRef

String


Echo of the customerRef if passed.

status

ExecutionReportStatus

(tick)


errorCode

ExecutionReportErrorCode



marketId

String


Echo of marketId passed

instructionReports

List< Betting Type Definitions#ReplaceInstructionReport ReplaceInstructionReport >





Anchor
ReplaceInstructionReport
ReplaceInstructionReport

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleReplaceInstructionReport


Field name

Type

Required

Description

status

InstructionReportStatus

(tick)

whether the command succeeded or failed

errorCode

InstructionReportErrorCode


cause of failure, or null if command succeeds

cancelInstructionReport

Betting Type Definitions#CancelInstructionReportCancelInstructionReport


Cancellation report for the original order

placeInstructionReport

Betting Type Definitions#PlaceInstructionReportPlaceInstructionReport


Placement report for the new order


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleCancelInstructionReport


Field name

Type

Required

Description

status

InstructionReportStatus

(tick)

whether the command succeeded or failed

errorCode

InstructionReportErrorCode


cause of failure, or null if command succeeds

instruction

Betting Type Definitions#CancelInstructionCancelInstruction


The instruction that was requested

sizeCancelled

double

(tick)


cancelledDate

Date




...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleUpdateExecutionReport


Field name

Type

Required

Description

customerRef

String


Echo of the customerRef if passed.

status

ExecutionReportStatus

(tick)


errorCode

ExecutionReportErrorCode



marketId

String


Echo of marketId passed

instructionReports

List< Betting Type Definitions#UpdateInstructionReport UpdateInstructionReport >





Anchor
UpdateInstructionReport
UpdateInstructionReport

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleUpdateInstructionReport


Field name

Type

Required

Description

status

InstructionReportStatus

(tick)

whether the command succeeded or failed

errorCode

InstructionReportErrorCode


cause of failure, or null if command succeeds

instruction

Betting Type Definitions#UpdateInstructionUpdateInstruction

(tick)

The instruction that was requested


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titlePriceProjection

Selection criteria of the returning price data

Field name

Type

Required

Description

priceData

Set< PriceData >


The basic price data you want to receive in the response.

exBestOffersOverrides

Betting Type Definitions#ExBestOffersOverridesOffersOverrides


Options to alter the default representation of best offer prices Applicable to EX_BEST_OFFERS priceData selection

virtualise

boolean


Indicates if the returned prices should include virtual prices. Applicable to EX_BEST_OFFERS and EX_ALL_OFFERS priceData selections, default value is false. Please note: This must be set to 'true' replicate the display of prices on the Betfair Exchange website.

rolloverStakes

boolean


Indicates if the volume returned at each price point should be the absolute value or a cumulative sum of volumes available at the price and all better prices. If unspecified defaults to false. Applicable to EX_BEST_OFFERS and EX_ALL_OFFERS price projections. Not supported as yet.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleMarketProfitAndLoss

Profit and loss in a market

Field name

Type

Required

Description

marketId

String


The unique identifier for the market

commissionApplied

double


The commission rate applied to P&L values. Only returned if netOfCommision option is requested

profitAndLosses

List<Betting Type Definitions#RunnerProfitAndLossRunnerProfitAndLoss>


Calculated profit and loss data.


...

Panel
bgColor#FFFFFF
titleBGColor#FFCC33
titleRunnerProfitAndLoss

Profit and loss if selection is wins or loses


Field name

Type

Required

Description

selectionId

Betting Type Definitions#SelectionIdSelection


The unique identifier for the selection

ifWin

double


Profit or loss for the market if this selection is the winner.

ifLose

double


Profit or loss for the market if this selection is the loser. Only returned for multi-winner odds markets.

ifPlace

double


Profit or loss for the market if this selection is placed. Applies to marketType EACH_WAY only.


...

Field name

Type

Required

Description

selectionId

Betting Type Definitions#SelectionIdSelectionId

Selection ID of the runner in the key line handicap.

handicap

Betting Type Definitions#HandicapHandicap

Handicap value of the key line.

...

Field name

Type

Required

Description

keyLine

List<Betting Type Definitions#KeyLineSelectionKeyLineSelection>

A list of KeyLineSelection objects

...