Which API should I use?

  • Use v20 REST API only if you have a v20 account
  • Use v1 REST API if your account id contains only digits (ie. 2534253) as it is a legacy account

Pricing Definitions


Price is an application/json object with the following Schema:

{
    # 
    # The string “PRICE”. Used to identify the a Price object when found in a
    # stream.
    # 
    type : (string, default=PRICE),

    # 
    # The Price’s Instrument.
    # 
    instrument : (InstrumentName),

    # 
    # The date/time when the Price was created
    # 
    time : (DateTime),

    # 
    # The status of the Price.
    # 
    # 
    # Deprecated: Will be removed in a future API update.
    # 
    status : (PriceStatus, deprecated),

    # 
    # Flag indicating if the Price is tradeable or not
    # 
    tradeable : (boolean),

    # 
    # The list of prices and liquidity available on the Instrument’s bid side.
    # It is possible for this list to be empty if there is no bid liquidity
    # currently available for the Instrument in the Account.
    # 
    bids : (Array[PriceBucket]),

    # 
    # The list of prices and liquidity available on the Instrument’s ask side.
    # It is possible for this list to be empty if there is no ask liquidity
    # currently available for the Instrument in the Account.
    # 
    asks : (Array[PriceBucket]),

    # 
    # The closeout bid Price. This Price is used when a bid is required to
    # closeout a Position (margin closeout or manual) yet there is no bid
    # liquidity. The closeout bid is never used to open a new position.
    # 
    closeoutBid : (PriceValue),

    # 
    # The closeout ask Price. This Price is used when a ask is required to
    # closeout a Position (margin closeout or manual) yet there is no ask
    # liquidity. The closeout ask is never used to open a new position.
    # 
    closeoutAsk : (PriceValue),

    # 
    # The factors used to convert quantities of this price’s Instrument’s quote
    # currency into a quantity of the Account’s home currency.
    # 
    # 
    # Deprecated: Will be removed in a future API update.
    # 
    quoteHomeConversionFactors : (QuoteHomeConversionFactors, deprecated),

    # 
    # Representation of how many units of an Instrument are available to be
    # traded by an Order depending on its postionFill option.
    # 
    # 
    # Deprecated: Will be removed in a future API update.
    # 
    unitsAvailable : (UnitsAvailable, deprecated)
}

Type string
Format A decimal number encodes as a string. The amount of precision provided depends on the Price’s Instrument.

PriceBucket is an application/json object with the following Schema:

{
    # 
    # The Price offered by the PriceBucket
    # 
    price : (PriceValue),

    # 
    # The amount of liquidity offered by the PriceBucket
    # 
    liquidity : (integer)
}

Value Description
tradeable The Instrument’s price is tradeable.
non-tradeable The Instrument’s price is not tradeable.
invalid The Instrument of the price is invalid or there is no valid Price for the Instrument.

UnitsAvailableDetails is an application/json object with the following Schema:

{
    # 
    # The units available for long Orders.
    # 
    long : (DecimalNumber),

    # 
    # The units available for short Orders.
    # 
    short : (DecimalNumber)
}

UnitsAvailable is an application/json object with the following Schema:

{
    # 
    # The number of units that are available to be traded using an Order with a
    # positionFill option of “DEFAULT”. For an Account with hedging enabled,
    # this value will be the same as the “OPEN_ONLY” value. For an Account
    # without hedging enabled, this value will be the same as the
    # “REDUCE_FIRST” value.
    # 
    default : (UnitsAvailableDetails),

    # 
    # The number of units that may are available to be traded with an Order
    # with a positionFill option of “REDUCE_FIRST”.
    # 
    reduceFirst : (UnitsAvailableDetails),

    # 
    # The number of units that may are available to be traded with an Order
    # with a positionFill option of “REDUCE_ONLY”.
    # 
    reduceOnly : (UnitsAvailableDetails),

    # 
    # The number of units that may are available to be traded with an Order
    # with a positionFill option of “OPEN_ONLY”.
    # 
    openOnly : (UnitsAvailableDetails)
}

QuoteHomeConversionFactors is an application/json object with the following Schema:

{
    # 
    # The factor used to convert a positive amount of the Price’s Instrument’s
    # quote currency into a positive amount of the Account’s home currency.
    # Conversion is performed by multiplying the quote units by the conversion
    # factor.
    # 
    positiveUnits : (DecimalNumber),

    # 
    # The factor used to convert a negative amount of the Price’s Instrument’s
    # quote currency into a negative amount of the Account’s home currency.
    # Conversion is performed by multiplying the quote units by the conversion
    # factor.
    # 
    negativeUnits : (DecimalNumber)
}

PricingHeartbeat is an application/json object with the following Schema:

{
    # 
    # The string “HEARTBEAT”
    # 
    type : (string, default=HEARTBEAT),

    # 
    # The date/time when the Heartbeat was created.
    # 
    time : (DateTime)
}