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)

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

{
    # 
    # The type of the tag.
    # 
    type : (string),

    # 
    # The name of the tag.
    # 
    name : (string)
}

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

Value Description
SUNDAY Sunday
MONDAY Monday
TUESDAY Tuesday
WEDNESDAY Wednesday
THURSDAY Thursday
FRIDAY Friday
SATURDAY Saturday

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

{
    # 
    # The day of the week to charge the financing.
    # 
    dayOfWeek : (DayOfWeek),

    # 
    # The number of days worth of financing to be charged on dayOfWeek.
    # 
    daysCharged : (integer)
}

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

{
    # 
    # The financing rate to be used for a long position for the instrument. The
    # value is in decimal rather than percentage points, i.e. 5% is represented
    # as 0.05.
    # 
    longRate : (DecimalNumber),

    # 
    # The financing rate to be used for a short position for the instrument.
    # The value is in decimal rather than percentage points, i.e. 5% is
    # represented as 0.05.
    # 
    shortRate : (DecimalNumber),

    # 
    # The days of the week to debit or credit financing charges; the exact time
    # of day at which to charge the financing is set in the
    # DivisionTradingGroup for the client’s account.
    # 
    financingDaysOfWeek : (Array[FinancingDayOfWeek])
}

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),

    # 
    # Financing data for this instrument.
    # 
    financing : (InstrumentFinancing),

    # 
    # The tags associated with this instrument.
    # 
    tags : (Array[Tag])
}

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 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)
}

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

{
    # 
    # Applies to Trades with a guaranteed Stop Loss Order attached for the
    # specified Instrument. This is the total allowed Trade volume that can
    # exist within the priceRange based on the trigger prices of the guaranteed
    # Stop Loss Orders.
    # 
    volume : (DecimalNumber),

    # 
    # The price range the volume applies to. This value is in price units.
    # 
    priceRange : (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.

Type string
Format Can contain any combination of the characters “M” (midpoint candles) “B” (bid candles) and “A” (ask candles).