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

Primitives Definitions


Type string
Format A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

Type string
Format A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

Type string
Format A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217)

Type string
Format A string containing the base currency and quote currency delimited by a “_”.

Value Description
CURRENCY Currency
CFD Contract For Difference
METAL Metal

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

{
    # 
    # The name of the Instrument
    # 
    name : (InstrumentName),

    # 
    # The type of the Instrument
    # 
    type : (InstrumentType),

    # 
    # The display name of the Instrument
    # 
    displayName : (string),

    # 
    # The location of the “pip” for this instrument. The decimal position of
    # the pip in this Instrument’s price can be found at 10 ^ pipLocation (e.g.
    # -4 pipLocation results in a decimal pip position of 10 ^ -4 = 0.0001).
    # 
    pipLocation : (integer),

    # 
    # The number of decimal places that should be used to display prices for
    # this instrument. (e.g. a displayPrecision of 5 would result in a price of
    # “1” being displayed as “1.00000”)
    # 
    displayPrecision : (integer),

    # 
    # The amount of decimal places that may be provided when specifying the
    # number of units traded for this instrument.
    # 
    tradeUnitsPrecision : (integer),

    # 
    # The smallest number of units allowed to be traded for this instrument.
    # 
    minimumTradeSize : (DecimalNumber),

    # 
    # The maximum trailing stop distance allowed for a trailing stop loss
    # created for this instrument. Specified in price units.
    # 
    maximumTrailingStopDistance : (DecimalNumber),

    # 
    # The minimum trailing stop distance allowed for a trailing stop loss
    # created for this instrument. Specified in price units.
    # 
    minimumTrailingStopDistance : (DecimalNumber),

    # 
    # The maximum position size allowed for this instrument. Specified in
    # units.
    # 
    maximumPositionSize : (DecimalNumber),

    # 
    # The maximum units allowed for an Order placed for this instrument.
    # Specified in units.
    # 
    maximumOrderUnits : (DecimalNumber),

    # 
    # The margin rate for this instrument.
    # 
    marginRate : (DecimalNumber),

    # 
    # The commission structure for this instrument.
    # 
    commission : (InstrumentCommission)
}

Type string
Format The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

Value Description
UNIX If “UNIX” is specified DateTime fields will be specified or returned in the “12345678.000000123” format.
RFC3339 If “RFC3339” is specified DateTime will be specified or returned in “YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ” format.

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

{
    # 
    # The name of the instrument
    # 
    instrument : (InstrumentName),

    # 
    # The commission amount (in the Account’s home currency) charged per
    # unitsTraded of the instrument
    # 
    commission : (DecimalNumber),

    # 
    # The number of units traded that the commission amount is based on.
    # 
    unitsTraded : (DecimalNumber),

    # 
    # The minimum commission amount (in the Account’s home currency) that is
    # charged when an Order is filled for this instrument.
    # 
    minimumCommission : (DecimalNumber)
}

Value Description
LONG A long Order is used to to buy units of an Instrument. A Trade is long when it has bought units of an Instrument.
SHORT A short Order is used to to sell units of an Instrument. A Trade is short when it has sold units of an Instrument.