Skip to content

Latest commit

 

History

History
3885 lines (2685 loc) · 150 KB

DerivAPI.md

File metadata and controls

3885 lines (2685 loc) · 150 KB

Table of Contents

Main Modules

DerivAPI

The main class of the DerivAPI module. This class extends the minimum functionality provided by the DerivAPIBasic adding abstract objects that can be used to read data and interact with the API.

Parameters

Properties

  • basic DerivAPIBasic Basic API, used for making low-level calls to the API

Examples

// Returns an abstract ticks object
const ticks = api.ticks('R_100');

// Subscribe to updates on the ticks object
ticks.onUpdate().subscribe(console.log);

// Read the last ticks available in the default range
const ticks_history = ticks.list;

// Read the last 100 ticks until yesterday
const older_history = await ticks.history({ count: 100, end: new Date(yesterday) });

// Access to low-level API
const api_basic = api.basic;

ticks

Provides a ticks stream and a list of available ticks

Parameters

Returns Promise<Ticks>

candles

Provides a list of available candles with the default granularity

Parameters

Returns Promise<Candles>

contract

A contract object with latest market values, cannot be bought or sold

Parameters

Returns Promise<Contract>

underlying

An underlying object, including contract groups, pip size, etc.

Parameters
  • symbol String The underlying symbol

Returns Promise<Underlying>

account

An account object, including loginid, balance, contracts, etc.

Parameters
  • token String Token to create the account with

Returns Promise<Account>

assets

Trading assets including multiple underlyings and trading times

Returns Promise<Assets>

websiteStatus

Website status stream

Returns Promise<WebsiteStatus>

contractOptions

Request contract options to display in UI

Parameters
  • symbol

Returns Promise<ContractOptions>

DerivAPIBasic

Extends DerivAPICalls

The minimum functionality provided by DerivAPI, provides direct calls to the API. api.cache is available if you want to use the cached data (see Cache)

Parameters

  • options Object (optional, default {})
    • options.app_id Number Application ID of the API user
    • options.connection WebSocket? A ready to use connection
    • options.endpoint String API server to connect to (optional, default 'ws.derivws.com')
    • options.lang String Language of the API communication (optional, default 'EN')
    • options.brand String Brand name (optional, default '')
    • options.middleware Object A middleware to call on certain API actions (optional, default {})
    • options.storage
    • options.cache (optional, default new InMemory())

Properties

  • events Observable
  • cache Cache Temporary cache default to @link{InMemory}
  • storage Cache If specified, uses a more presistent cache (local storage, etc.)

Examples

const apiFromOpenConnection = new DerivAPI({ connection });
const apiFromEndpoint = new DerivAPI({ endpoint: 'ws.derivws.com', app_id: 1234 });

closeHandler

Reconnects to the API in case of connection error, unless connection is passed as an argument, in that case reconnecting should be handled in the API user side.

reconnect

Clears previous connection keeplive ping timeout and connect & assign the handles

onClose

Returns Observable for close events

onOpen

Returns Observable for open events

onMessage

Returns Observable for new messages

expectResponse

Parameters
  • types String Expect these types to be received by the API

Returns (Promise<Object> | Promise<Array>) Resolves to a single response or an array

Abstract Objects

Immutables

Abstract objects that provide static content and methods to make use of them, changing internal fields of these objects is blocked and they do not receive updates.

Account

Extends Immutable

Abstract class for user accounts

Parameters
Properties
Examples
const account = await api.accounts(your_token);

// Returns the open contracts of this account
const open_contracts = account.open_contracts;

const siblings = account.siblings;

// Switches the API account to the first sibling
// The existing account instance is not authorized anymore and should be discarded
const sibling = await api.account(loginidToToken(siblings[0].loginid));

Assets

Extends Immutable

Abstract class for trading assets

Parameters
Properties
Examples
const assets = await api.assets();

// Get the current open markets
const open_markets = assets.open_markets;

const trading_times = assets.trading_times;

Underlying

Extends Immutable

Abstract class for an underlying

Parameters
Properties
Examples
const underlying = await api.underlying('R_100');

const pip_sized = underlying.pipSizedValue(123.1);

// Same as api.tickStream(symbol);
const tick_stream = underlying.tickStream();

if (underlying.is_open) await contract.buy();
toPipSized

Returns the pipSized display of the value in string

Parameters
  • value
ticks

Shortcut for api.ticks(symbol)

candles

Shortcut for api.candles(symbol)

Tick

Extends Immutable

A wrapper class for Tick

Parameters
Properties

Candle

Extends Immutable

A wrapper class for Candle

Parameters
Properties

Transaction

Extends Immutable

A class for transaction objects

Parameters
Properties

Buy

Extends Immutable

Wrapper around a Buy response

Parameters
Properties

Sell

Extends Immutable

Wrapper around a Sell response

Parameters
Properties

ContractOptions

Extends Immutable

Abstract objects for options needed to create a contract

Parameters
  • api
  • symbol
Properties

Streams

Live stream of data, plus some dynamically updated fields, you can subscribe to changes using the onUpdate method on all of these classes.

Balance

Extends Stream

An abstract class for balance information

Parameters
Properties
  • amount Monetary
  • value Number numeric balance value
  • currency String currency of the amount
  • display String display value of amount (decimal point)
  • format String formatted amount (decimal point, comma separated)
Examples
const balance = accounts.balance;

const formatted_balance = balance.format;

balance.onUpdate().subscribe(balance => console.log)

Candles

Extends Stream

An abstract class for Candles stream returned from DerivAPI#candleStream

Parameters
Properties
history

Resolves to a list of candles given the range

Parameters
Examples
const old_candles = await candle_stream.history({count: 10, end: yesterday})

Returns Promise<Array<Candle>>

Contract

Extends Stream

Abstract class for contracts

Parameters
Properties
  • status String 'proposal', 'open', 'expired', 'sold', 'won', 'lost'
  • ask_price Monetary Price to pay to buy a contract
  • type String contract type
  • payout Monetary Potential or realized payout
  • longcode String
  • symbol String
  • currency String
  • current_spot Spot
  • start_time CustomDate Start time of the contract (estimated for proposal)
  • buy_price Monetary? (After buy)
  • bid_price Monetary? (After buy)
  • sell_price Monetary? (After sell)
  • profit Profit? Potential or realized profit (After buy)
  • proposal_id Number? The proposal ID used to buy
  • id Number? The contract ID (After buy)
  • purchase_time CustomDate? (After buy)
  • expiry_time CustomDate? (After buy)
  • sell_time CustomDate? (After sell)
  • barrier_count Number? (For contracts with barrier)
  • high_barrier MarketValue? (For contracts with two barriers)
  • low_barrier MarketValue? (For contracts with two barriers)
  • barrier MarketValue? (For contracts with one barrier)
  • tick_count Number? (For tick contracts)
  • ticks Array<Tick>? (For tick contracts)
  • multiplier Number? (For loopback contracts)
  • shortcode String?
  • validation_error String?
  • is_forward_starting Boolean?
  • is_intraday Boolean?
  • is_path_dependent Boolean?
  • is_valid_to_sell Boolean? We still allow a sell call, let API handle the error
  • is_expired Boolean?
  • is_settleable Boolean?
  • is_open Boolean? Is this contract still open
  • entry_spot Spot?
  • exit_spot Spot?
  • audit_details Object?
  • code FullName? only if both short and long codes are available
Examples
const contract = account.contract({ contract_type: 'CALL', ...options })

const buy = await contract.buy();

contract.onUpdate().subscribe(console.log)
buy

Buys this contract

Parameters
  • buy BuyParam (optional, default {})
    • buy.max_price (optional, default this.ask_price.value)

Returns Buy

sell

Sells this contract

Parameters
  • sell SellParam zero price means sell at market (optional, default {})
    • sell.max_price (optional, default 0)

Returns Sell

Ticks

Extends Stream

Abstract class for ticks stream returned by the DerivAPI#tickStream

Parameters
Properties
  • list Array<Tick> An immutable list of ticks
history

Resolves to a list of Ticks using the given range

Parameters
Examples
const old_ticks = await tickStream.history({count: 10, end: yesterday})

Returns Promise<Array<Tick>>

Transactions

Extends Stream

A stream of transactions

Parameters
Properties
Examples
const tx_stream = accounts.transaction_stream;

const tx_list = tx_stream.list;

tx_stream.onUpdate(console.log)

WebsiteStatus

Extends Stream

An abstract class for website status info

Parameters
Properties
Examples
const website_status = await api.websiteStatus();

const is_website_up = website_status.is_website_up;

website_status.onUpdate(s => console.log(`Site is ${s.status}`));

Fields

Container classes for data types, providing means to convert them to other types and represent them to the UI. These are mostly simpler objects used for representing data.

Barrier

Extends MarketValue

A barrier info, either absolute or relative

Parameters
Properties

CustomDate

Extends Immutable

An alternative date object

Parameters
Properties
isBefore
Parameters

Returns Boolean

isSameOrAfter
Parameters

Returns Boolean

isSameOrBefore
Parameters

Returns Boolean

isAfter
Parameters

Returns Boolean

isSame
Parameters

Returns Boolean

addDuration

Adds a duration to the current date

Parameters

Returns CustomDate

DateRange

Extends Immutable

An abstract class for date range

Parameters

Duration

Extends Immutable

Duration object

Parameters
Properties
addToDate

Adds this duration to a date object

Parameters

Returns CustomDate

DurationRange

Extends Immutable

An abstract class for date range

Parameters

FullName

Extends Immutable

A class for keeping short and full name of things

Parameters
  • short_name
  • full String Full form of the name
  • short String short form of the name
Properties
Examples
const lc = account.landing_company;

console.log(`Landing Company: ${lc.full}, Short code: ${lc.short}`);

MarketValue

Extends Immutable

Keeps a market value and pip size

Parameters
Properties

Monetary

Extends Immutable

Keeps money related values

Parameters
Properties
  • value Number
  • currency String
  • display String decimal value based on currency
  • format String comma separated decimal value based on currency

Profit

Extends Monetary

Keeps money related values

Parameters
Properties
  • value Number Absolute value of the profit
  • percentage Number
  • sign Number 0: no profit, 1: positive profit, -1: loss
  • is_win Boolean True if the initial profit is positive
  • currency String
  • display String decimal value based on currency
  • format String comma separated decimal value based on currency

Spot

Extends MarketValue

Keeps a market value at a time

Parameters
Properties

Core Functionality

Cache

Extends DerivAPICalls

Cache - A class for implementing in-memory and persistent cache

The real implementation of the underlying cache is delegated to the storage object (See the params).

The storage object needs to implement the API.

Parameters

  • api DerivAPIBasic API instance to get data that is not cached
  • storage Object A storage instance to use for caching

Examples

// Read the latest active symbols
const symbols = await api.activeSymbols();

// Read the data from cache if available
const cached_symbols = await api.cache.activeSymbols();

SubscriptionManager

Subscription Manager - manage subscription channels

Makes sure there is always only one subscription channel for all requests of subscriptions, keeps a history of received values for the subscription of ticks and forgets channels that do not have subscribers. It also ensures that subscriptions are revived after connection drop/account changed.

Parameters

  • api

Examples

// This one creates a new subscription assuming it is the first one for R_100
const subscriber1 = api.subscribe({ ticks: 'R_100' }, console.log);

// This one uses the existing subscription to R_100
const subscriber2 = api.subscribe({ ticks: 'R_100' }, console.log);

subscriber1.unsubscribe(); // no API forget yet
subscriber2.unsubscribe(); // Issues API forget

subscribe

Subscribe to a given request, returns a stream of new responses, Errors should be handled by the user of the stream

Parameters
  • request Object A request object acceptable by the API
Examples
const ticks = api.subscribe({ ticks: 'R_100' });
ticks.subscribe(console.log) // Print every new tick

Returns Observable An RxJS Observable

Object References

These are plain JavaScript objects that are named to easily refer to them in this documentation, they don't physically exist as a class in this codebase.

Parameters

CandlesParam

Type: Object

Properties
  • granularity Number Granularity in seconds
  • range HistoryRange A chunk of history to return with start and end time
  • symbol String Symbol of the candles

TicksParam

Type: Object

Properties
  • range HistoryRange A chunk of history to return with start and end time
  • symbol String The ticks symbol

BuyParam

Type: Object

Properties
  • max_price Number? Maximum acceptable price for buying the contract

SellParam

Type: Object

Properties
  • max_price Number? Maximum acceptable price for selling the contract

ContractParam

Type: Object

Properties

HistoryRange

Type: Object

Properties
  • start (Number | Date) An epoch in seconds or a Date object
  • end (Number | Date) An epoch in seconds or a Date object
  • count Number Number of ticks returned by history

accountClosure

Parameters

  • args Object (optional, default {})
    • args.account_closure Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.reason String Reason for closing off accounts.
    • args.req_id Number [Optional] Used to map request to response.

accountSecurity

Parameters

  • args Object (optional, default {})
    • args.account_security Number Must be 1
    • args.otp String [Optional] OTP (one-time passcode) generated by a 2FA application like Authy, Google Authenticator or Yubikey.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.totp_action String [Optional] Action to be taken for managing TOTP (time-based one-time password, RFC6238). Generate will create a secret key which is then returned in the secret_key response field, you can then enable by using that code in a 2FA application.

accountStatistics

Parameters

  • args Object (optional, default {})
    • args.account_statistics Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

activeSymbols

Parameters

  • args Object (optional, default {})
    • args.active_symbols String If you use brief, only a subset of fields will be returned.
    • args.landing_company String [Optional] If you specify this field, only symbols available for trading by that landing company will be returned. If you are logged in, only symbols available for trading by your landing company will be returned regardless of what you specify in this field.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.product_type String [Optional] If you specify this field, only symbols that can be traded through that product type will be returned.
    • args.req_id Number [Optional] Used to map request to response.

affiliateAccountAdd

Parameters

  • args Object (optional, default {})
    • args.account_opening_reason String [Optional] Purpose and reason for requesting the account opening.
    • args.account_turnover String [Optional] The anticipated account turnover.
    • args.address_city String [Optional] Within 100 characters.
    • args.address_line_1 String Within 70 characters, with no leading whitespaces and may contain letters/numbers and/or any of following characters '.,:;()@#/-
    • args.address_line_2 String [Optional] Within 70 characters.
    • args.address_postcode String [Optional] Within 20 characters and may not contain '+'.
    • args.address_state String [Optional] Possible value receive from states_list call.
    • args.affiliate_account_add Number Must be 1
    • args.affiliate_plan String The affiliate plan the account will subscribe to
    • args.affiliate_token String [Optional] Affiliate token, within 32 characters.
    • args.citizen Any [Optional] Country of legal citizenship, 2-letter country code.
    • args.client_type String [Optional] Indicates whether this is for a client requesting an account with professional status.
    • args.currency String [Optional] To set currency of the account. List of supported currencies can be acquired with payout_currencies call.
    • args.date_of_birth String Date of birth format: yyyy-mm-dd.
    • args.first_name String Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.last_name String Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.non_pep_declaration Number [Optional] Indicates client's self-declaration of not being a PEP/RCA (Politically Exposed Person/Relatives and Close Associates).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.phone Any [Optional] Starting with + followed by 9-35 digits, hyphens or space.
    • args.place_of_birth String [Optional] Place of birth, 2-letter country code.
    • args.req_id Number [Optional] Used to map request to response.
    • args.residence String 2-letter country code, possible value receive from residence_list call.
    • args.salutation String [Optional] Accept any value in enum list.
    • args.secret_answer String [Optional] Answer to secret question, within 4-50 characters. Required for new account and existing client details will be used if client open another account.
    • args.secret_question String [Optional] Accept any value in enum list. Required for new account and existing client details will be used if client open another account.
    • args.tax_identification_number String [Optional] Tax identification number. Only applicable for real money account. Required for maltainvest landing company.
    • args.tax_residence String [Optional] Residence for tax purpose. Comma separated iso country code if multiple jurisdictions. Only applicable for real money account. Required for maltainvest landing company.

apiToken

Parameters

  • args Object (optional, default {})
    • args.api_token Number Must be 1
    • args.delete_token String [Optional] The token to remove.
    • args.new_token String [Optional] The name of the created token.
    • args.new_token_scopes Any [Optional] List of permission scopes to provide with the token.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.valid_for_current_ip_only Number [Optional] If you set this parameter during token creation, then the token created will only work for the IP address that was used to create the token

appDelete

Parameters

  • args Object (optional, default {})
    • args.app_delete Number Application app_id
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

appGet

Parameters

  • args Object (optional, default {})
    • args.app_get Number Application app_id
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

appList

Parameters

  • args Object (optional, default {})
    • args.app_list Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

appMarkupDetails

Parameters

  • args Object (optional, default {})
    • args.app_id Number [Optional] Specific application app_id to report on.
    • args.app_markup_details Number Must be 1
    • args.client_loginid String [Optional] Specific client loginid to report on, like CR12345
    • args.date_from String Start date (epoch or YYYY-MM-DD HH:MM:SS). Results are inclusive of this time.
    • args.date_to String End date (epoch or YYYY-MM-DD HH::MM::SS). Results are inclusive of this time.
    • args.description Number [Optional] If set to 1, will return app_markup transaction details.
    • args.limit Number [Optional] Apply upper limit to count of transactions received.
    • args.offset Number [Optional] Number of transactions to skip.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.sort String [Optional] Sort direction on transaction_time. Other fields sort order is ASC.
    • args.sort_fields Any [Optional] One or more of the specified fields to sort on. Default sort field is by transaction_time.

appRegister

Parameters

  • args Object (optional, default {})
    • args.app_markup_percentage Number [Optional] Markup to be added to contract prices (as a percentage of contract payout).
    • args.app_register Number Must be 1
    • args.appstore String [Optional] Application's App Store URL (if applicable).
    • args.github String [Optional] Application's GitHub page (for open-source projects).
    • args.googleplay String [Optional] Application's Google Play URL (if applicable).
    • args.homepage String [Optional] Application's homepage URL.
    • args.name String Application name.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.redirect_uri String [Optional] The URL to redirect to after a successful login. Required if charging markup percentage
    • args.req_id Number [Optional] Used to map request to response.
    • args.scopes Any List of permission scopes to grant the application.
    • args.verification_uri String [Optional] Used when verify_email called. If available, a URL containing the verification token will be sent to the client's email, otherwise only the token will be sent.

appUpdate

Parameters

  • args Object (optional, default {})
    • args.app_markup_percentage Number [Optional] Markup to be added to contract prices (as a percentage of contract payout).
    • args.app_update Number Application app_id.
    • args.appstore String [Optional] Application's App Store URL (if applicable).
    • args.github String [Optional] Application's GitHub page (for open-source projects).
    • args.googleplay String [Optional] Application's Google Play URL (if applicable).
    • args.homepage String [Optional] Application's homepage URL.
    • args.name String Application name.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.redirect_uri String [Optional] The URL to redirect to after a successful login. Required if charging markup percentage.
    • args.req_id Number [Optional] Used to map request to response.
    • args.scopes Any Change scopes will revoke all user's grants and log them out.
    • args.verification_uri String [Optional] Used when verify_email called. If available, a URL containing the verification token will send to the client's email, otherwise only the token will be sent.

assetIndex

Parameters

  • args Object (optional, default {})
    • args.asset_index Number Must be 1
    • args.landing_company String [Optional] If specified, will return only the underlyings for the specified landing company.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

authorize

Parameters

  • args Object (optional, default {})
    • args.add_to_login_history Number [Optional] Send this when you use api tokens for authorization and want to track activity using login_history call.
    • args.authorize String Authentication token. May be retrieved from https://www.binary.com/en/user/security/api_tokenws.html
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

balance

Parameters

  • args Object (optional, default {})
    • args.account String [Optional] If set to all, return the balances of all accounts one by one; if set to current, return the balance of current account; if set as an account id, return the balance of that account.
    • args.balance Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever the balance changes.

buy

Parameters

  • args Object (optional, default {})
    • args.buy String Either the ID received from a Price Proposal (proposal call), or 1 if contract buy parameters are passed in the parameters field.
    • args.parameters Any -
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.price Number Maximum price at which to purchase the contract.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] 1 to stream.

buyContractForMultipleAccounts

Parameters

  • args Object (optional, default {})
    • args.buy_contract_for_multiple_accounts String Either the ID received from a Price Proposal (proposal call), or 1 if contract buy parameters are passed in the parameters field.
    • args.parameters Any -
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.price Number Maximum price at which to purchase the contract.
    • args.req_id Number [Optional] Used to map request to response.
    • args.tokens Any List of API tokens identifying the accounts for which the contract is bought. Note: If the same token appears multiple times or if multiple tokens designate the same account, the contract is bought multiple times for this account.

cancel

Parameters

  • args Object (optional, default {})
    • args.cancel Number Value should be the contract_id which received from the portfolio call.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

cashier

Parameters

  • args Object (optional, default {})
    • args.address String [Optional] Address for crypto withdrawal. Only applicable for api type.
    • args.amount Number [Optional] Amount for crypto withdrawal. Only applicable for api type.
    • args.cashier String Operation which needs to be requested from cashier
    • args.dry_run Number [Optional] If set to 1, only validation is performed. Only applicable for withdraw using crypto provider and api type.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.provider String [Optional] Cashier provider. crypto will be default option for crypto currency accounts.
    • args.req_id Number [Optional] Used to map request to response.
    • args.type String [Optional] Data need to be returned from cashier. api is supported only for crypto provider.
    • args.verification_code String [Optional] Email verification code (received from a verify_email call, which must be done first)

cashierPayments

Parameters

  • args Object (optional, default {})
    • args.cashier_payments Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.provider String [Optional] Cashier provider. crypto will be default option for crypto currency accounts.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever there is update to crypto payments.
    • args.transaction_type String [Optional] Type of transactions to receive.

cashierWithdrawalCancel

Parameters

  • args Object (optional, default {})
    • args.cashier_withdrawal_cancel Number Must be 1
    • args.id String The unique identifier for the transaction.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

changePassword

Parameters

  • args Object (optional, default {})
    • args.change_password Number Must be 1
    • args.new_password String New password (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address)
    • args.old_password String Old password for validation (non-empty string, accepts any printable ASCII character)
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

contractUpdate

Parameters

  • args Object (optional, default {})
    • args.contract_id Number Internal unique contract identifier.
    • args.contract_update Number Must be 1
    • args.limit_order Any -
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

contractUpdateHistory

Parameters

  • args Object (optional, default {})
    • args.contract_id Number Internal unique contract identifier.
    • args.contract_update_history Number Must be 1
    • args.limit Number [Optional] Maximum number of historical updates to receive.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

contractsFor

Parameters

  • args Object (optional, default {})
    • args.contracts_for String The short symbol name (obtained from active_symbols call).
    • args.currency String [Optional] Currency of the contract's stake and payout (obtained from payout_currencies call).
    • args.landing_company String [Optional] Indicates which landing company to get a list of contracts for. If you are logged in, your account's landing company will override this field.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.product_type String [Optional] If you specify this field, only contracts tradable through that contract type will be returned.
    • args.req_id Number [Optional] Used to map request to response.

copyStart

Parameters

  • args Object (optional, default {})
    • args.assets Any [Optional] Used to set assets to be copied. E.x ["frxUSDJPY", "R_50"]
    • args.copy_start String API tokens identifying the accounts of trader which will be used to copy trades
    • args.max_trade_stake Number [Optional] Used to set maximum trade stake to be copied.
    • args.min_trade_stake Number [Optional] Used to set minimal trade stake to be copied.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trade_types Any [Optional] Used to set trade types to be copied. E.x ["CALL", "PUT"]

copyStop

Parameters

  • args Object (optional, default {})
    • args.copy_stop String API tokens identifying the accounts which needs not to be copied
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

copytradingList

Parameters

  • args Object (optional, default {})
    • args.copytrading_list Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

copytradingStatistics

Parameters

  • args Object (optional, default {})
    • args.copytrading_statistics Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trader_id String The ID of the target trader.

documentUpload

Parameters

  • args Object (optional, default {})
    • args.document_format String Document file format
    • args.document_id String [Optional] Document ID (required for Passport, Proof of ID and Driver's License)
    • args.document_issuing_country String [Optional] 2-letter country code
    • args.document_type String Document type
    • args.document_upload Number Must be 1
    • args.expected_checksum String The checksum of the file to be uploaded
    • args.expiration_date String [Optional] Document expiration date (required for Passport, Proof of ID and Driver's License)
    • args.file_size Number Document size (should be less than 10MB)
    • args.lifetime_valid Number [Optional] Boolean value that indicates whether this document is lifetime valid (only applies to POI document types, cancels out the expiration_date given if any)
    • args.page_type String [Optional] To determine document side
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

economicCalendar

Parameters

  • args Object (optional, default {})
    • args.currency String [Optional] Currency symbol.
    • args.economic_calendar Number Must be 1
    • args.end_date Number [Optional] End date.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.start_date Number [Optional] Start date.

exchangeRates

Parameters

  • args Object (optional, default {})
    • args.base_currency String Base currency (can be obtained from payout_currencies call)
    • args.exchange_rates Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

forget

Parameters

  • args Object (optional, default {})
    • args.forget String ID of the real-time stream of messages to cancel.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

forgetAll

Parameters

  • args Object (optional, default {})
    • args.forget_all Any Cancel all streams by type. The value can be either a single type e.g. "ticks", or an array of multiple types e.g. ["candles", "ticks"].
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

getAccountStatus

Parameters

  • args Object (optional, default {})
    • args.get_account_status Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

getFinancialAssessment

Parameters

  • args Object (optional, default {})
    • args.get_financial_assessment Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

getLimits

Parameters

  • args Object (optional, default {})
    • args.get_limits Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

getSelfExclusion

Parameters

  • args Object (optional, default {})
    • args.get_self_exclusion Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

getSettings

Parameters

  • args Object (optional, default {})
    • args.get_settings Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

identityVerificationDocumentAdd

Parameters

  • args Object (optional, default {})
    • args.document_number String The identification number of the document.
    • args.document_type String The type of the document based on provided issuing_country (can obtained from residence_list call).
    • args.identity_verification_document_add Number Must be 1
    • args.issuing_country String 2-letter country code (can obtained from residence_list call).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

landingCompany

Parameters

  • args Object (optional, default {})
    • args.landing_company String Client's 2-letter country code (obtained from residence_list call).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

landingCompanyDetails

Parameters

  • args Object (optional, default {})
    • args.landing_company_details String Landing company shortcode.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

linkWallet

Parameters

  • args Object (optional, default {})
    • args.client_id String The unique identifier for this trading account.
    • args.link_wallet Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.wallet_id String The unique identifier for this wallet.

loginHistory

Parameters

  • args Object (optional, default {})
    • args.limit Number [Optional] Apply limit to count of login history records.
    • args.login_history Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

logout

Parameters

  • args Object (optional, default {})
    • args.logout Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

mt5Deposit

Parameters

  • args Object (optional, default {})
    • args.amount Number Amount to deposit (in the currency of from_binary); min = $1 or an equivalent amount, max = $20000 or an equivalent amount
    • args.from_binary String Binary account loginid to transfer money from
    • args.mt5_deposit Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.to_mt5 String MT5 account login to deposit money to

mt5GetSettings

Parameters

  • args Object (optional, default {})
    • args.login String MT5 user login
    • args.mt5_get_settings Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

mt5LoginList

Parameters

  • args Object (optional, default {})
    • args.mt5_login_list Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

mt5NewAccount

Parameters

  • args Object (optional, default {})
    • args.account_type String Account type. If set to 'financial', setting 'mt5_account_type' is also required.
    • args.address String [Optional] The address of the user. The maximum length of this address field is 128 characters.
    • args.city String [Optional] User's city of residence.
    • args.company String [Optional] Name of the client's company. The maximum length of the company name is 64 characters.
    • args.country String [Optional] 2-letter country code (value received from residence_list call).
    • args.currency String [Optional] MT5 account currency, the default value will be the qualified account currency.
    • args.dry_run Number [Optional] If set to 1, only validation is performed.
    • args.email String Email address
    • args.investPassword String [Optional] The investor password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.leverage Number Client leverage (from 1 to 1000).
    • args.mainPassword String The master password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address). This field is required.
    • args.mt5_account_category String [Optional] To choose whether account is conventional or swap_free. Unavailable for financial_stp MT5_account_type
    • args.mt5_account_type String [Optional] Financial: Variable spreads, High leverage. Financial STP: Variable spreads, Medium Leverage, more products. If 'account_type' set to 'financial', setting 'mt5_account_type' is also required.
    • args.mt5_new_account Number Must be 1
    • args.name String Client's name. The maximum length here is 101 characters.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.phone String [Optional] User's phone number.
    • args.phonePassword String [Optional] The user's phone password.
    • args.req_id Number [Optional] Used to map request to response.
    • args.server Any [Optional] Trade server.
    • args.state String [Optional] User's state (region) of residence.
    • args.zipCode String [Optional] User's zip code.

mt5PasswordChange

Parameters

  • args Object (optional, default {})
    • args.login String MT5 user login
    • args.mt5_password_change Number Must be 1
    • args.new_password String New password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.old_password String Old password for validation (non-empty string, accepts any printable ASCII character)
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.password_type String [Optional] Type of the password to change.
    • args.req_id Number [Optional] Used to map request to response.

mt5PasswordCheck

Parameters

  • args Object (optional, default {})
    • args.login String MT5 user login
    • args.mt5_password_check Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.password String The password of the account.
    • args.password_type String [Optional] Type of the password to check.
    • args.req_id Number [Optional] Used to map request to response.

mt5PasswordReset

Parameters

  • args Object (optional, default {})
    • args.login String MT5 user login
    • args.mt5_password_reset Number Must be 1
    • args.new_password String New password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.password_type String [Optional] Type of the password to reset.
    • args.req_id Number [Optional] Used to map request to response.
    • args.verification_code String Email verification code (received from a verify_email call, which must be done first)

mt5Withdrawal

Parameters

  • args Object (optional, default {})
    • args.amount Number Amount to withdraw (in the currency of the MT5 account); min = $1 or an equivalent amount, max = $20000 or an equivalent amount.
    • args.from_mt5 String MT5 account login to withdraw money from
    • args.mt5_withdrawal Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.to_binary String Binary account loginid to transfer money to

newAccountMaltainvest

Parameters

  • args Object (optional, default {})
    • args.accept_risk Number Show whether client has accepted risk disclaimer.
    • args.account_opening_reason String [Optional] Purpose and reason for requesting the account opening.
    • args.account_turnover String [Optional] The anticipated account turnover.
    • args.address_city String Within 100 characters
    • args.address_line_1 String Within 70 characters, with no leading whitespaces and may contain letters/numbers and/or any of following characters '.,:;()@#/-
    • args.address_line_2 String [Optional] Within 70 characters.
    • args.address_postcode String [Optional] Within 20 characters and may not contain '+'.
    • args.address_state String [Optional] Possible value receive from states_list call.
    • args.affiliate_token String [Optional] Affiliate token, within 32 characters.
    • args.binary_options_trading_experience String [Optional] Binary options trading experience.
    • args.binary_options_trading_frequency String [Optional] Binary options trading frequency.
    • args.cfd_trading_experience String [Optional] CFDs trading experience.
    • args.cfd_trading_frequency String [Optional] CFDs trading frequency.
    • args.citizen String [Optional] Country of legal citizenship, 2-letter country code. Possible value receive from residence_list call.
    • args.client_type String [Optional] Indicates whether this is for a client requesting an account with professional status.
    • args.date_of_birth String Date of birth format: yyyy-mm-dd.
    • args.education_level String Level of Education
    • args.employment_industry String Industry of Employment.
    • args.employment_status String [Optional] Employment Status.
    • args.estimated_worth String Estimated Net Worth.
    • args.first_name String Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.forex_trading_experience String [Optional] Forex trading experience.
    • args.forex_trading_frequency String [Optional] Forex trading frequency.
    • args.income_source String Income Source.
    • args.last_name String Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.net_income String Net Annual Income.
    • args.new_account_maltainvest Number Must be 1
    • args.non_pep_declaration Number [Optional] Indicates client's self-declaration of not being a PEP/RCA.
    • args.occupation String Occupation.
    • args.other_instruments_trading_experience String [Optional] Trading experience in other financial instruments.
    • args.other_instruments_trading_frequency String [Optional] Trading frequency in other financial instruments.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.phone Any [Optional] Starting with + followed by 9-35 digits, hyphens or space.
    • args.place_of_birth String [Optional] Place of birth, 2-letter country code.
    • args.req_id Number [Optional] Used to map request to response.
    • args.residence String 2-letter country code, possible value receive from residence_list call.
    • args.salutation String Accept any value in enum list.
    • args.secret_answer String [Optional] Answer to secret question, within 4-50 characters.
    • args.secret_question String [Optional] Accept any value in enum list.
    • args.source_of_wealth String [Optional] Source of wealth.
    • args.tax_identification_number String Tax identification number. Only applicable for real money account. Required for maltainvest landing company.
    • args.tax_residence String Residence for tax purpose. Comma separated iso country code if multiple jurisdictions. Only applicable for real money account. Required for maltainvest landing company.

newAccountReal

Parameters

  • args Object (optional, default {})
    • args.account_opening_reason String [Optional] Purpose and reason for requesting the account opening.
    • args.account_turnover String [Optional] The anticipated account turnover.
    • args.address_city String [Optional] Within 100 characters.
    • args.address_line_1 String Within 70 characters, with no leading whitespaces and may contain letters/numbers and/or any of following characters '.,:;()@#/-
    • args.address_line_2 String [Optional] Within 70 characters.
    • args.address_postcode String [Optional] Within 20 characters and may not contain '+'.
    • args.address_state String [Optional] Possible value receive from states_list call.
    • args.affiliate_token String [Optional] Affiliate token, within 32 characters.
    • args.citizen Any [Optional] Country of legal citizenship, 2-letter country code.
    • args.client_type String [Optional] Indicates whether this is for a client requesting an account with professional status.
    • args.currency String [Optional] To set currency of the account. List of supported currencies can be acquired with payout_currencies call.
    • args.date_of_birth String Date of birth format: yyyy-mm-dd.
    • args.first_name String Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.last_name String Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.new_account_real Number Must be 1
    • args.non_pep_declaration Number [Optional] Indicates client's self-declaration of not being a PEP/RCA (Politically Exposed Person/Relatives and Close Associates).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.phone Any [Optional] Starting with + followed by 9-35 digits, hyphens or space.
    • args.place_of_birth String [Optional] Place of birth, 2-letter country code.
    • args.req_id Number [Optional] Used to map request to response.
    • args.residence String 2-letter country code, possible value receive from residence_list call.
    • args.salutation String [Optional] Accept any value in enum list.
    • args.secret_answer String [Optional] Answer to secret question, within 4-50 characters. Required for new account and existing client details will be used if client open another account.
    • args.secret_question String [Optional] Accept any value in enum list. Required for new account and existing client details will be used if client open another account.
    • args.tax_identification_number String [Optional] Tax identification number. Only applicable for real money account. Required for maltainvest landing company.
    • args.tax_residence String [Optional] Residence for tax purpose. Comma separated iso country code if multiple jurisdictions. Only applicable for real money account. Required for maltainvest landing company.

newAccountVirtual

Parameters

  • args Object (optional, default {})
    • args.affiliate_token String [Optional] Affiliate token, within 32 characters.
    • args.client_password String Password (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.date_first_contact String [Optional] Date of first contact, format: yyyy-mm-dd in GMT timezone.
    • args.email_consent Number [Optional] Boolean value: 1 or 0, indicating whether the client has given consent for marketing emails.
    • args.gclid_url String [Optional] Google Click Identifier to track source.
    • args.new_account_virtual Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.residence String 2-letter country code (obtained from residence_list call).
    • args.signup_device String [Optional] Show whether user has used mobile or desktop.
    • args.type String Account type
    • args.utm_ad_id Any [Optional] Identifier of particular ad. Value must match Regex pattern to be recorded
    • args.utm_adgroup_id Any [Optional] Identifier of ad group in the campaign. Value must match Regex pattern to be recorded
    • args.utm_adrollclk_id Any [Optional] Unique identifier of click on AdRoll ads platform. Value must match Regex pattern to be recorded
    • args.utm_campaign Any [Optional] Identifies a specific product promotion or strategic campaign such as a spring sale or other promotions. Value must match Regex pattern to be recorded
    • args.utm_campaign_id Any [Optional] Identifier of paid ad campaign. Value must match Regex pattern to be recorded
    • args.utm_content Any [Optional] Used to differentiate similar content, or links within the same ad. Value must match Regex pattern to be recorded
    • args.utm_fbcl_id Any [Optional] Unique identifier of click on Facebook ads platform. Value must match Regex pattern to be recorded
    • args.utm_gl_client_id Any [Optional] Unique visitor identifier on Google Ads platform. Value must match Regex pattern to be recorded
    • args.utm_medium Any [Optional] Identifies the medium the link was used upon such as: email, CPC, or other methods of sharing. Value must match Regex pattern to be recorded
    • args.utm_msclk_id Any [Optional] Unique click identifier on Microsoft Bing ads platform. Value must match Regex pattern to be recorded
    • args.utm_source Any [Optional] Identifies the source of traffic such as: search engine, newsletter, or other referral. Value must match Regex pattern to be recorded
    • args.utm_term Any [Optional] Used to send information related to the campaign term like paid search keywords. Value must match Regex pattern to be recorded
    • args.verification_code String Email verification code (received from a verify_email call, which must be done first).

newAccountWallet

Parameters

  • args Object (optional, default {})
    • args.address_city String [Optional] Within 35 characters.
    • args.address_line_1 String [Optional] Mailing address.
    • args.address_line_2 String [Optional] Within 70 characters.
    • args.address_postcode String [Optional] Within 20 characters and may not contain '+'.
    • args.address_state String [Optional] Possible value receive from states_list call.
    • args.currency String [Optional] To set currency of the account. List of supported currencies can be acquired with payout_currencies call.
    • args.date_of_birth String [Optional] Date of birth format: yyyy-mm-dd.
    • args.first_name String [Optional] Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.last_name String [Optional] Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
    • args.new_account_wallet Number Must be 1
    • args.non_pep_declaration Number [Optional] Indicates client's self-declaration of not being a PEP/RCA (Politically Exposed Person/Relatives and Close Associates).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_method String To set method which is used to transfer to/from wallet.
    • args.phone String [Optional] Starting with + followed by 8-35 digits, allowing hyphens or space.
    • args.req_id Number [Optional] Used to map request to response.

notificationEvent

Parameters

  • args Object (optional, default {})
    • args.args Any -
    • args.category String The category or nature of the event.
    • args.event String The name of the event.
    • args.notification_event Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

oauthApps

Parameters

  • args Object (optional, default {})
    • args.oauth_apps Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

p2pAdvertCreate

Parameters

  • args Object (optional, default {})
    • args.amount Number The total amount of the advert, in advertiser's account currency.
    • args.contact_info String [Optional] Advertiser contact information. Only applicable for 'sell adverts'.
    • args.description String [Optional] General information about the advert.
    • args.local_currency String [Optional] Local currency for this advert. If not provided, will use the currency of client's residence by default.
    • args.max_order_amount Number Maximum allowed amount for the orders of this advert, in advertiser's account_currency. Should be less than or equal to total amount of the advert.
    • args.min_order_amount Number Minimum allowed amount for the orders of this advert, in advertiser's account_currency. Should be less than max_order_amount.
    • args.p2p_advert_create Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_info String [Optional] Payment instructions. Only applicable for 'sell adverts'.
    • args.payment_method String Supported payment methods. Separate multiple values with a comma, maximum 3.
    • args.payment_method_ids Any IDs of payment methods, only applicable for sell ads.
    • args.rate Number Conversion rate from advertiser's account currency to local_currency.
    • args.req_id Number [Optional] Used to map request to response.
    • args.type String Whether this is a buy or a sell.

p2pAdvertInfo

Parameters

  • args Object (optional, default {})
    • args.id String [Optional] The unique identifier for this advert. Optional when subscribe is 1. If not provided, all advertiser adverts will be subscribed.
    • args.p2p_advert_info Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates when changes occur. Optional when id is provided.
    • args.use_client_limits Number [Optional] If set to 1, the maximum order amount will be adjusted to the current balance and turnover limits of the account.

p2pAdvertList

Parameters

  • args Object (optional, default {})
    • args.advertiser_id String [Optional] ID of the advertiser to list adverts for.
    • args.advertiser_name String [Optional] Search for advertiser by name. Partial matches will be returned.
    • args.amount Number [Optional] How much to buy or sell, used to calculate prices.
    • args.counterparty_type String [Optional] Filter the adverts by counterparty_type.
    • args.favourites_only Number [Optional] Only show adverts from favourite advertisers. Default is 0.
    • args.limit Number [Optional] Used for paging.
    • args.local_currency String [Optional] Currency to conduct payment transaction in, defaults to the main currency for the client's country.
    • args.offset Number [Optional] Used for paging.
    • args.p2p_advert_list Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_method Any [Optional] Search by supported payment methods.
    • args.req_id Number [Optional] Used to map request to response.
    • args.sort_by String [Optional] How the results are sorted: best rate, or advertiser completion rate.
    • args.use_client_limits Number [Optional] If set to 1, ads that exceed this account's balance or turnover limits will not be shown.

p2pAdvertUpdate

Parameters

  • args Object (optional, default {})
    • args.delete Number [Optional] If set to 1, permanently deletes the advert.
    • args.id String The unique identifier for this advert.
    • args.is_active Number [Optional] Activate or deactivate the advert.
    • args.p2p_advert_update Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_method String [Optional] Supported payment methods. Separate multiple values with a comma, maximum 3.
    • args.payment_method_ids Any [Optional] IDs of payment methods, only applicable for sell ads. Will replace exisiting methods.
    • args.req_id Number [Optional] Used to map request to response.

p2pAdvertiserAdverts

Parameters

  • args Object (optional, default {})
    • args.limit Number [Optional] Used for paging. This value will also apply to subsription responses.
    • args.offset Number [Optional] Used for paging. This value will also apply to subsription responses.
    • args.p2p_advertiser_adverts Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

p2pAdvertiserCreate

Parameters

  • args Object (optional, default {})
    • args.contact_info String [Optional] Advertiser's contact information, to be used as a default for new sell adverts.
    • args.default_advert_description String [Optional] Default description that can be used every time an advert is created.
    • args.name String The advertiser's displayed name.
    • args.p2p_advertiser_create Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_info String [Optional] Advertiser's payment information, to be used as a default for new sell adverts.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever there is an update to advertiser

p2pAdvertiserInfo

Parameters

  • args Object (optional, default {})
    • args.id String [Optional] The unique identifier for this advertiser. If not provided, returns advertiser information about the current account.
    • args.p2p_advertiser_info Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever there is an update to advertiser

p2pAdvertiserPaymentMethods

Parameters

  • args Object (optional, default {})
    • args.create Any Contains new payment method entries.
    • args.delete Any Contains payment methods to delete.
    • args.p2p_advertiser_payment_methods Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.update Any Contains payment methods to update.

p2pAdvertiserRelations

Parameters

  • args Object (optional, default {})
    • args.add_blocked Any IDs of advertisers to block.
    • args.add_favourites Any IDs of advertisers to add as favourites.
    • args.p2p_advertiser_relations Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.remove_blocked Any IDs of advertisers to remove from blocked.
    • args.remove_favourites Any IDs of advertisers to remove from favourites.
    • args.req_id Number [Optional] Used to map request to response.

p2pAdvertiserUpdate

Parameters

  • args Object (optional, default {})
    • args.contact_info String [Optional] Advertiser's contact information, to be used as a default for new sell adverts.
    • args.default_advert_description String [Optional] Default description that can be used every time an advert is created.
    • args.is_listed Number [Optional] Used to set if the advertiser's adverts could be listed. When 0, adverts won't be listed regardless of they are active or not. This doesn't change the is_active of each individual advert.
    • args.p2p_advertiser_update Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_info String [Optional] Advertiser's payment information, to be used as a default for new sell adverts.
    • args.req_id Number [Optional] Used to map request to response.
    • args.show_name Number [Optional] When 1, the advertiser's real name will be displayed on to other users on adverts and orders.

p2pChatCreate

Parameters

  • args Object (optional, default {})
    • args.order_id String The unique identifier for the order to create the chat for.
    • args.p2p_chat_create Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

p2pOrderCancel

Parameters

  • args Object (optional, default {})
    • args.id String The unique identifier for this order.
    • args.p2p_order_cancel Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

p2pOrderConfirm

Parameters

  • args Object (optional, default {})
    • args.id String The unique identifier for this order.
    • args.p2p_order_confirm Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

p2pOrderCreate

Parameters

  • args Object (optional, default {})
    • args.advert_id String The unique identifier for the advert to create an order against.
    • args.amount Number The amount of currency to be bought or sold.
    • args.contact_info String [Optional] Seller contact information. Only applicable for 'sell orders'.
    • args.p2p_order_create Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_info String [Optional] Payment instructions, only applicable for sell orders.
    • args.payment_method_ids Any IDs of payment methods, only applicable for sell orders.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever there is an update to the order.

p2pOrderDispute

Parameters

  • args Object (optional, default {})
    • args.dispute_reason String The predefined dispute reason
    • args.id String The unique identifier for this order.
    • args.p2p_order_dispute Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

p2pOrderInfo

Parameters

  • args Object (optional, default {})
    • args.id String The unique identifier for the order.
    • args.p2p_order_info Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever there is an update to order

p2pOrderList

Parameters

  • args Object (optional, default {})
    • args.active Number [Optional] Should be 1 to list active, 0 to list inactive (historical).
    • args.advert_id String [Optional] If present, lists orders applying to a specific advert.
    • args.limit Number [Optional] Used for paging.
    • args.offset Number [Optional] Used for paging.
    • args.p2p_order_list Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever there is a change to any order belonging to you.

p2pPaymentMethods

Parameters

  • args Object (optional, default {})
    • args.p2p_payment_methods Number Must be 1
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.

paymentMethods

Parameters

  • args Object (optional, default {})
    • args.country String [Optional] 2-letter country code (ISO standard).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_methods Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.

paymentagentCreate

Parameters

  • args Object (optional, default {})
    • args.affiliate_id String [Optional] Client's My Affiliate id, if exists.
    • args.code_of_conduct_approval Number Indicates client's agreement with the Code of Conduct.
    • args.commission_deposit Number Commission (%) the agent wants to take on deposits
    • args.commission_withdrawal Number Commission (%) the agent wants to take on withdrawals
    • args.email String Payment agent's email address.
    • args.information String [Optional] Information about payment agent and their proposed service.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payment_agent_name String The name with which the payment agent is going to be identified.
    • args.paymentagent_create Number Must be 1
    • args.phone String Payment agent's phone number with coutry code.
    • args.req_id Number [Optional] Used to map request to response.
    • args.supported_payment_methods Any A list of supported payment methods.
    • args.url String The URL of payment agent's website.

paymentagentDetails

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.paymentagent_details Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.

paymentagentList

Parameters

  • args Object (optional, default {})
    • args.currency String [Optional] If specified, only payment agents that supports that currency will be returned (obtained from payout_currencies call).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.paymentagent_list String Client's 2-letter country code (obtained from residence_list call).
    • args.req_id Number [Optional] Used to map request to response.

paymentagentTransfer

Parameters

  • args Object (optional, default {})
    • args.amount Number The amount to transfer.
    • args.currency String Currency code.
    • args.description String [Optional] Remarks about the transfer.
    • args.dry_run Number [Optional] If set to 1, just do validation.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.paymentagent_transfer Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.
    • args.transfer_to String The loginid of the recipient account.

paymentagentWithdraw

Parameters

  • args Object (optional, default {})
    • args.amount Number The amount to withdraw to the payment agent.
    • args.currency String The currency code.
    • args.description String [Optional] Remarks about the withdraw. Only letters, numbers, space, period, comma, - ' are allowed.
    • args.dry_run Number [Optional] If set to 1, just do validation.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.paymentagent_loginid String The payment agent loginid received from the paymentagent_list call.
    • args.paymentagent_withdraw Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.
    • args.verification_code String Email verification code (received from a verify_email call, which must be done first)

payoutCurrencies

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.payout_currencies Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.

ping

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.ping Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.

portfolio

Parameters

  • args Object (optional, default {})
    • args.contract_type Any Return only contracts of the specified types
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.portfolio Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.

profitTable

Parameters

  • args Object (optional, default {})
    • args.contract_type Any Return only contracts of the specified types
    • args.date_from String [Optional] Start date (epoch or YYYY-MM-DD)
    • args.date_to String [Optional] End date (epoch or YYYY-MM-DD)
    • args.description Number [Optional] If set to 1, will return full contracts description.
    • args.limit Number [Optional] Apply upper limit to count of transactions received.
    • args.offset Number [Optional] Number of transactions to skip.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.profit_table Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.
    • args.sort String [Optional] Sort direction.

proposal

Parameters

  • args Object (optional, default {})
    • args.amount Number [Optional] Proposed contract payout or stake, or multiplier (for lookbacks).
    • args.barrier String [Optional] Barrier for the contract (or last digit prediction for digit contracts). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), where entry spot would be adjusted accordingly with that amount to define a barrier, except for Synthetic Indices as they support both relative and absolute barriers. Not needed for lookbacks.
    • args.barrier2 String [Optional] Low barrier for the contract (for contracts with two barriers). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), where entry spot would be adjusted accordingly with that amount to define a barrier, except for Synthetic Indices as they support both relative and absolute barriers. Not needed for lookbacks.
    • args.basis String [Optional] Indicates type of the amount.
    • args.cancellation String Cancellation duration option (only for MULTUP and MULTDOWN contracts).
    • args.contract_type String The proposed contract type
    • args.currency String This can only be the account-holder's currency (obtained from payout_currencies call).
    • args.date_expiry Number [Optional] Epoch value of the expiry time of the contract. Either date_expiry or duration is required.
    • args.date_start Number [Optional] Indicates epoch value of the starting time of the contract. If left empty, the start time of the contract is now.
    • args.duration Number [Optional] Duration quantity. Either date_expiry or duration is required.
    • args.duration_unit String [Optional] Duration unit - s: seconds, m: minutes, h: hours, d: days, t: ticks.
    • args.limit_order Any -
    • args.multiplier Number [Optional] The multiplier for non-binary options. E.g. lookbacks.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.product_type String [Optional] The product type.
    • args.proposal Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.
    • args.selected_tick Number [Optional] The tick that is predicted to have the highest/lowest value - for TICKHIGH and TICKLOW contracts.
    • args.subscribe Number [Optional] 1 - to initiate a realtime stream of prices. Note that tick trades (without a user-defined barrier), digit trades and less than 24 hours at-the-money contracts for the following underlying symbols are not streamed: R_10, R_25, R_50, R_75, R_100, RDBULL, RDBEAR (this is because their price is constant).
    • args.symbol String The short symbol name (obtained from active_symbols call).
    • args.trading_period_start Number [Optional] Required only for multi-barrier trading. Defines the epoch value of the trading period start time.

proposalOpenContract

Parameters

  • args Object (optional, default {})
    • args.contract_id Number [Optional] Contract ID received from a portfolio request. If not set, you will receive stream of all open contracts.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.proposal_open_contract Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] 1 to stream.

realityCheck

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.reality_check Number Must be 1
    • args.req_id Number [Optional] Used to map request to response.

requestReport

Parameters

  • args Object (optional, default {})
    • args.date_from Number Start date of the report
    • args.date_to Number End date of the report
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.report_type String Type of report to be sent to client's registered e-mail address
    • args.req_id Number [Optional] Used to map request to response.
    • args.request_report Number Must be 1

resetPassword

Parameters

  • args Object (optional, default {})
    • args.date_of_birth String [Optional] Date of birth format: yyyy-mm-dd. Only required for clients with real-money accounts.
    • args.new_password String New password. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.reset_password Number Must be 1
    • args.verification_code String Email verification code (received from a verify_email call, which must be done first)

residenceList

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.residence_list Number Must be 1

revokeOauthApp

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.revoke_oauth_app Number The application ID to revoke.

sell

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.price Number Minimum price at which to sell the contract, or 0 for 'sell at market'.
    • args.req_id Number [Optional] Used to map request to response.
    • args.sell Number Pass contract_id received from the portfolio call.

sellContractForMultipleAccounts

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.price Number Minimum price at which to sell the contract, or 0 for 'sell at market'.
    • args.req_id Number [Optional] Used to map request to response.
    • args.sell_contract_for_multiple_accounts Number Must be 1
    • args.shortcode String An internal ID used to identify the contract which was originally bought. This is returned from the buy and buy_contract_for_multiple_accounts calls.
    • args.tokens Any Authorisation tokens which select the accounts to sell use for the affected accounts.

sellExpired

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.sell_expired Number Must be 1

serviceToken

Parameters

  • args Object (optional, default {})
    • args.country String [Optional] The 2-letter country code.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.referrer String [Optional] The URL of the web page where the Web SDK will be used.
    • args.req_id Number [Optional] Used to map request to response.
    • args.server String Server (dxtrade only).
    • args.service Any The service(s) to retrieve token(s) for.
    • args.service_token Number Must be 1

setAccountCurrency

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.set_account_currency String Currency of the account. List of supported currencies can be acquired with payout_currencies call.

setFinancialAssessment

Parameters

  • args Object (optional, default {})
    • args.account_turnover String [Optional] The anticipated account turnover.
    • args.binary_options_trading_experience String [Optional] Binary options trading experience.
    • args.binary_options_trading_frequency String [Optional] Binary options trading frequency.
    • args.cfd_trading_experience String [Optional] CFDs trading experience.
    • args.cfd_trading_frequency String [Optional] CFDs trading frequency.
    • args.education_level String Level of Education.
    • args.employment_industry String Industry of Employment.
    • args.employment_status String [Optional] Employment Status.
    • args.estimated_worth String Estimated Net Worth.
    • args.forex_trading_experience String [Optional] Forex trading experience.
    • args.forex_trading_frequency String [Optional] Forex trading frequency.
    • args.income_source String Income Source.
    • args.net_income String Net Annual Income.
    • args.occupation String Occupation.
    • args.other_instruments_trading_experience String [Optional] Trading experience in other financial instruments.
    • args.other_instruments_trading_frequency String [Optional] Trading frequency in other financial instruments.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.set_financial_assessment Number Must be 1
    • args.source_of_wealth String [Optional] Source of wealth.

setSelfExclusion

Parameters

  • args Object (optional, default {})
    • args.exclude_until Any [Optional] Exclude me from the website (for a minimum of 6 months, up to a maximum of 5 years). Note: uplifting this self-exclusion may require contacting the company.
    • args.max_30day_deposit Any [Optional] 7-day limit on deposits.
    • args.max_30day_losses Any [Optional] 30-day limit on losses.
    • args.max_30day_turnover Any [Optional] 30-day turnover limit.
    • args.max_7day_deposit Any [Optional] 7-day limit on deposits.
    • args.max_7day_losses Any [Optional] 7-day limit on losses.
    • args.max_7day_turnover Any [Optional] 7-day turnover limit.
    • args.max_balance Any [Optional] Maximum account cash balance.
    • args.max_deposit Any [Optional] Daily deposit limit.
    • args.max_losses Any [Optional] Daily limit on losses.
    • args.max_open_bets Any [Optional] Maximum number of open positions.
    • args.max_turnover Any [Optional] Daily turnover limit.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.session_duration_limit Any [Optional] Session duration limit, in minutes.
    • args.set_self_exclusion Number Must be 1
    • args.timeout_until Any [Optional] Exclude me from the website (for up to 6 weeks). Requires time in epoch format. Note: unlike exclude_until, this self-exclusion will be lifted automatically at the expiry of the timeout period.

setSettings

Parameters

  • args Object (optional, default {})
    • args.account_opening_reason String [Optional] Purpose and reason for requesting the account opening. Only applicable for real money account. Required for clients that have not set it yet. Can only be set once.
    • args.address_city String [Optional] Note: not applicable for virtual account. Required field for real money account.
    • args.address_line_1 String [Optional] Note: not applicable for virtual account. Required field for real money account.
    • args.address_line_2 Any [Optional] Note: not applicable for virtual account. Optional field for real money account.
    • args.address_postcode String [Optional] Note: not applicable for virtual account. Optional field for real money account.
    • args.address_state String [Optional] Note: not applicable for virtual account. Optional field for real money account.
    • args.allow_copiers Number [Optional] Boolean value 1 or 0, indicating permission to allow others to follow your trades. Note: not applicable for Virtual account. Only allow for real money account.
    • args.citizen Any [Optional] Country of legal citizenship, 2-letter country code.
    • args.date_of_birth String [Optional] Date of birth format: yyyy-mm-dd (can only be changed on unauthenticated svg accounts).
    • args.email_consent Number [Optional] Boolean value 1 or 0, indicating permission to use email address for any contact which may include marketing
    • args.feature_flag Any -
    • args.first_name String [Optional] Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes (can only be changed on unauthenticated svg accounts).
    • args.last_name String [Optional] Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes (can only be changed on unauthenticated svg accounts).
    • args.non_pep_declaration Number [Optional] Indicates client's self-declaration of not being a PEP/RCA (Politically Exposed Person/Relatives and Close Associates). Effective for real accounts only.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.phone Any [Optional] Note: not applicable for virtual account. Starting with + followed by 9-35 digits, hyphens or space.
    • args.place_of_birth String [Optional] Place of birth, 2-letter country code.
    • args.preferred_language Any [Optional] User's preferred language, ISO standard language code
    • args.req_id Number [Optional] Used to map request to response.
    • args.request_professional_status Number [Optional] Required when client wants to be treated as professional. Applicable for financial accounts only.
    • args.residence Any [Optional] 2-letter country code. Note: not applicable for real money account. Only allow for Virtual account without residence set.
    • args.salutation String [Optional] Accept any value in enum list (can only be changed on unauthenticated svg accounts).
    • args.secret_answer String [Optional] Answer to secret question, within 4-50 characters. Required for new account and existing client details will be used if client opens another account.
    • args.secret_question String [Optional] Accept any value in enum list. Required for new account and existing client details will be used if client opens another account.
    • args.set_settings Number Must be 1
    • args.tax_identification_number String [Optional] Tax identification number. Only applicable for real money account. Required for maltainvest landing company.
    • args.tax_residence String [Optional] Residence for tax purpose. Comma separated iso country code if multiple jurisdictions. Only applicable for real money account. Required for maltainvest landing company.

statement

Parameters

  • args Object (optional, default {})
    • args.action_type String [Optional] To filter the statement according to the type of transaction.
    • args.date_from Number [Optional] Start date (epoch)
    • args.date_to Number [Optional] End date (epoch)
    • args.description Number [Optional] If set to 1, will return full contracts description.
    • args.limit Number [Optional] Maximum number of transactions to receive.
    • args.offset Number [Optional] Number of transactions to skip.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.statement Number Must be 1

statesList

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.states_list String Client's 2-letter country code (obtained from residence_list call)

ticks

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] If set to 1, will send updates whenever a new tick is received.
    • args.ticks Any The short symbol name or array of symbols (obtained from active_symbols call).

ticksHistory

Parameters

  • args Object (optional, default {})
    • args.adjust_start_time Number [Optional] 1 - if the market is closed at the end time, or license limit is before end time, adjust interval backwards to compensate.
    • args.count Number [Optional] An upper limit on ticks to receive.
    • args.end String Epoch value representing the latest boundary of the returned ticks. If latest is specified, this will be the latest available timestamp.
    • args.granularity Number [Optional] Only applicable for style: candles. Candle time-dimension width setting. (default: 60).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.start Number [Optional] Epoch value representing the earliest boundary of the returned ticks.- For "style": "ticks": this will default to 1 day ago.
      • For "style": "candles": it will default to 1 day ago if count or granularity is undefined.
    • args.style String [Optional] The tick-output style.
    • args.subscribe Number [Optional] 1 - to send updates whenever a new tick is received.
    • args.ticks_history String Short symbol name (obtained from the active_symbols call).

time

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.time Number Must be 1

tncApproval

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.tnc_approval Number Must be 1
    • args.ukgc_funds_protection Number [Optional] For ASK_UK_FUNDS_PROTECTION in cashier.

topupVirtual

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.topup_virtual Number Must be 1

tradingDurations

Parameters

  • args Object (optional, default {})
    • args.landing_company String [Optional] If specified, will return only the underlyings for the specified landing company.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_durations Number Must be 1

tradingPlatformAccounts

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Trading platform name
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_platform_accounts Number Must be 1

tradingPlatformDeposit

Parameters

  • args Object (optional, default {})
    • args.amount Number Amount to deposit (in the currency of from_wallet).
    • args.from_account String Wallet account to transfer money from.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.to_account String Trading account login to deposit money to.
    • args.trading_platform_deposit Number Must be 1

tradingPlatformInvestorPasswordChange

Parameters

  • args Object (optional, default {})
    • args.account_id String Trading account ID.
    • args.new_password String New investor password. Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address.
    • args.old_password String Old investor password for validation (non-empty string, accepts any printable ASCII character)
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_platform_investor_password_change Number Must be 1

tradingPlatformInvestorPasswordReset

Parameters

  • args Object (optional, default {})
    • args.account_id String Trading account ID.
    • args.new_password String New password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_platform_investor_password_reset Number Must be 1
    • args.verification_code String Email verification code (received from a verify_email call, which must be done first)

tradingPlatformNewAccount

Parameters

  • args Object (optional, default {})
    • args.account_type String Account type.
    • args.currency String [Optional] Trading account currency, the default value will be the qualified account currency.
    • args.dry_run Number [Optional] If set to 1, only validation is performed.
    • args.market_type String Market type
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.password String The master password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address). This field is required.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.sub_account_type String [Optional] Sub account type.
    • args.trading_platform_new_account Number Must be 1

tradingPlatformPasswordChange

Parameters

  • args Object (optional, default {})
    • args.new_password String New trading password. Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address.
    • args.old_password String Old password for validation. Must be empty if a password has not been set yet.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_platform_password_change Number Must be 1

tradingPlatformPasswordReset

Parameters

  • args Object (optional, default {})
    • args.new_password String New password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_platform_password_reset Number Must be 1
    • args.verification_code String Email verification code (received from a verify_email call, which must be done first)

tradingPlatformWithdrawal

Parameters

  • args Object (optional, default {})
    • args.amount Number Amount to withdraw (in the currency of the Trading account).
    • args.from_account String Trading account login to withdraw money from.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String Name of trading platform.
    • args.req_id Number [Optional] Used to map request to response.
    • args.to_account String Wallet account loginid to transfer money to.
    • args.trading_platform_withdrawal Number Must be 1

tradingServers

Parameters

  • args Object (optional, default {})
    • args.account_type String [Optional] Trading account type.
    • args.environment String [Optional] Pass the environment (installation) instance. Currently, there are one demo and two real environments. Defaults to 'all'.
    • args.market_type String [Optional] Market type.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.platform String [Optional] Pass the trading platform name, default to mt5
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_servers Number Must be 1

tradingTimes

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.trading_times String Date to receive market opening times for. (yyyy-mm-dd format. today can also be specified).

transaction

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number If set to 1, will send updates whenever there is an update to transactions. If not to 1 then it will not return any records.
    • args.transaction Number Must be 1

transferBetweenAccounts

Parameters

  • args Object (optional, default {})
    • args.account_from String [Optional] The loginid of the account to transfer funds from.
    • args.account_to String [Optional] The loginid of the account to transfer funds to.
    • args.accounts String [Optional] To control the list of accounts returned when account_from or account_to is not provided. brief (default value) means that accounts with mt5 account_type will be excluded; it will run faster. all means that all accounts with any account_type (including mt5) will be returned.
    • args.amount Number [Optional] The amount to transfer.
    • args.currency String [Optional] Currency code.
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.transfer_between_accounts Number If account_from or account_to is not provided, it just returns the available accounts.

verifyEmail

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.type String Purpose of the email verification call.
    • args.url_parameters Any -
    • args.verify_email String Email address to be verified.

websiteStatus

Parameters

  • args Object (optional, default {})
    • args.passthrough Any [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
    • args.req_id Number [Optional] Used to map request to response.
    • args.subscribe Number [Optional] 1 to stream the server/website status updates.
    • args.website_status Number Must be 1

InMemory

An in memory storage which can be used for caching

TransactionParams

Type: Object

Immutable

An abstract class for immutable objects

Parameters

  • props Object A list of properties to add for the immutable object (optional, default {})

init

Override to initialize an immutable object asynchronously

ExpiryType

Type: Object

Properties

ContractCategory

Type: Object

Properties

Stream

Extends Immutable

An abstract class for stream objects

Parameters

  • args

onUpdate

Listen on updates of a stream

Parameters

Examples

const tick_stream = api.tickStream('R_100');

tick_stream.onUpdate(console.log);

tick_stream.onUpdate().subscribe(console.log);

Returns Observable