@deriv/deriv-api

1.0.11

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.

new DerivAPI(options: Object)
Parameters
options (Object) For options details see: DerivAPIBasic
Properties
basic (DerivAPIBasic) : Basic API, used for making low-level calls to the API
Example
// 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;
Instance Members
ticks(options)
candles(options)
contract(options)
underlying(symbol)
account(token)
assets()
websiteStatus()
contractOptions(symbol)

DerivAPIBasic

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)

new DerivAPIBasic(options: Object)

Extends DerivAPICalls

Parameters
options (Object = {})
Name Description
options.app_id Number Application ID of the API user
options.connection WebSocket? A ready to use connection
options.endpoint String (default 'frontend.binaryws.com') API server to connect to
options.lang String (default 'EN') Language of the API communication
options.brand String (default '') Brand name
options.middleware Object (default {}) A middleware to call on certain API actions
options.storage any
options.cache any (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.)
Example
const apiFromOpenConnection = new DerivAPI({ connection });
const apiFromEndpoint = new DerivAPI({ endpoint: 'ws.binaryws.com', app_id: 1234 });
Instance Members
closeHandler()
reconnect()
onClose()
onOpen()
onMessage()
expectResponse(types)

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

Abstract class for user accounts

new Account(api: DerivAPI, token: String)

Extends Immutable

Parameters
api (DerivAPI)
token (String)
Properties
loginid (String)
user_id (String)
email (String)
country (String)
currency (String)
risk (String)
show_authentication (Boolean)
landing_company (FullName)
balance (Balance)
transactions (Transactions)
status_codes (Array<String>)
siblings (Array<Object>)
contracts (Array<Contract>)
open_contracts (Array<Contract>)
closed_contracts (Array<Contract>)
api_tokens (Array<String>)
Example
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

Abstract class for trading assets

new Assets(api: DerivAPI)

Extends Immutable

Parameters
api (DerivAPI)
Properties
underlyings (Array<Underlying>)
open_markets (Array<Underlying>)
trading_times (Object)
trading_durations (Object)
Example
const assets = await api.assets();

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

const trading_times = assets.trading_times;

Underlying

Abstract class for an underlying

new Underlying(api: DerivAPI, symbol: String)

Extends Immutable

Parameters
api (DerivAPI)
symbol (String)
Properties
name (FullName)
is_open (Boolean)
is_trading_suspended (Boolean)
pip (Number)
pip_size (Number)
contract_groups (Object)
Example
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();
Instance Members
toPipSized(value)
ticks()
candles()

Tick

A wrapper class for Tick

new Tick(tick: Object, pip: Number)

Extends Immutable

Parameters
tick (Object)
Name Description
tick.epoch (Number | String)
tick.quote Number
tick.ask Number
tick.bid Number
pip (Number)
Properties
time (CustomDate)
quote (MarketValue)
ask (MarketValue)
bid (MarketValue)
raw (Object) : The raw data received from API

Candle

A wrapper class for Candle

new Candle(candle: Object, pip: Number)

Extends Immutable

Parameters
candle (Object)
Name Description
candle.epoch (Number | String)
candle.open Number
candle.high Number
candle.low Number
candle.close Number
pip (Number)
Properties
time (CustomDate) : The current time of the candle
open_time (CustomDate) : The time that candle opened
open (MarketValue)
high (MarketValue)
low (MarketValue)
close (MarketValue)
raw (Object) : The raw data received from API

Transaction

A class for transaction objects

new Transaction(transaction: Object, pip: Number, lang: any)

Extends Immutable

Parameters
transaction (Object)
Name Description
transaction.action String
transaction.currency String
transaction.amount Number
transaction.balance Number
transaction.high_barrier (String | Number)
transaction.low_barrier (String | Number)
transaction.barrier (String | Number)
transaction.longcode String
transaction.symbol String
transaction.display_name String Belongs to symbol
transaction.transaction_id Number
transaction.contract_id Number
transaction.purchase_time Number
transaction.expiry_time Number
transaction.transaction_time Number
pip (Number)
lang (any)
Properties
action (String)
longcode (String)
id (Number) : transaction ID
contract_id (Number)
symbol (FullName)
amount (Monetary)
balance (Monetary)
high_barrier (MarketValue)
low_barrier (MarketValue)
barrier (MarketValue)
purchase_time (CustomDate)
expiry_time (CustomDate)
time (CustomDate)
raw (Object) : The raw data received from API

ContractOptions

Abstract objects for options needed to create a contract

new ContractOptions(api: any, symbol: any)

Extends Immutable

Parameters
api (any)
symbol (any)
Properties
categories (Object)
currencies (Object)
  • currencies.usd String

    Example

Buy

Wrapper around a Buy response

new Buy(buy: any, currency: String, lang: any)

Extends Immutable

Parameters
buy (any)
Name Description
buy.buy_price Monetary
buy.balance_after Monetary
buy.payout Monetary
buy.start_time CustomDate
buy.purchase_time CustomDate
buy.contract_id Number
buy.transaction_id Number
buy.longcode String
buy.shortcode String
currency (String)
lang (any)
Properties
price (Monetary)
balance_after (Monetary)
payout (Monetary)
start_time (CustomDate)
purchase_time (CustomDate)
contract_id (Number)
transaction_id (Number)
code (FullName) : contains short and long code
longcode (String)
shortcode (String)

Sell

Wrapper around a Sell response

new Sell(sell: any, currency: String, lang: any)

Extends Immutable

Parameters
sell (any)
Name Description
sell.sold_for Monetary sell price
sell.balance_after Monetary
sell.contract_id Number
sell.transaction_id Number sell transaction
sell.reference_id Number buy transaction
currency (String)
lang (any)
Properties
price (Monetary)
balance_after (Monetary)
contract_id (Number)
transaction_id (Number)
buy_transaction (Number)

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

An abstract class for balance information

new Balance(api: DerivAPI)

Extends Stream

Parameters
api (DerivAPI)
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)
Example
const balance = accounts.balance;

const formatted_balance = balance.format;

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

Candles

An abstract class for Candles stream returned from DerivAPI#candleStream

new Candles(api: DerivAPI, options: CandlesParam?)

Extends Stream

Parameters
api (DerivAPI)
options (CandlesParam?)
Properties
list (Array<Candle>) : An immutable list of candles
Instance Members
history(range?)

Contract

Abstract class for contracts

new Contract(api: DerivAPI, options: ContractParam)

Extends Stream

Parameters
api (DerivAPI)
options (ContractParam)
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
Example
const contract = account.contract({ contract_type: 'CALL', ...options })

const buy = await contract.buy();

contract.onUpdate().subscribe(console.log)
Instance Members
buy(buy)
sell(sell)

Ticks

Abstract class for ticks stream returned by the DerivAPI#tickStream

new Ticks(api: DerivAPI, options: TicksParam)

Extends Stream

Parameters
api (DerivAPI)
options (TicksParam)
Properties
list (Array<Tick>) : An immutable list of ticks
Instance Members
history(range?)

Transactions

A stream of transactions

new Transactions(api: DerivAPI)

Extends Stream

Parameters
api (DerivAPI)
Properties
list (Array<Transaction>) : An immutable list of transactions
Example
const tx_stream = accounts.transaction_stream;

const tx_list = tx_stream.list;

tx_stream.onUpdate(console.log)

WebsiteStatus

An abstract class for website status info

new WebsiteStatus(api: DerivAPI)

Extends Stream

Parameters
api (DerivAPI)
Properties
status (String) : 'up', 'down'
is_website_up (Boolean)
country (String)
currencies (Object)
call_limits (Object)
languages (Array<String>)
terms_and_conditions_version (String)
Example
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

A barrier info, either absolute or relative

new Barrier(value: Number, pip: Number)

Extends MarketValue

Parameters
value (Number)
pip (Number)
Properties
type (String) : 'relative' or 'absolute'
sign (Number) : 0, -1, +1
is_relative (Boolean)

CustomDate

An alternative date object

new CustomDate(date: (CustomDate | Date | Number))

Extends Immutable

Parameters
date ((CustomDate | Date | Number))
Properties
epoch (Number)
epoch_milliseconds (Number)
date (Date)
Instance Members
isBefore(date)
isSameOrAfter(date)
isSameOrBefore(date)
isAfter(date)
isSame(date)
addDuration(duration)

DateRange

An abstract class for date range

new DateRange(min: CustomDate, max: CustomDate)

Extends Immutable

Parameters
min (CustomDate)
max (CustomDate)

Duration

Duration object

new Duration(duration: String)

Extends Immutable

Parameters
duration (String)
Properties
value (Number)
unit (String)
Instance Members
addToDate(date)

DurationRange

An abstract class for date range

new DurationRange(min: Duration, max: Duration)

Extends Immutable

Parameters
min (Duration)
max (Duration)

FullName

A class for keeping short and full name of things

new FullName(short_name: any, full: String, short: String)

Extends Immutable

Parameters
short_name (any)
full (String) Full form of the name
short (String) short form of the name
Properties
full (String)
long (String) : alias for full
short (String)
code (String) : alias for short
shortcode (String) : alias for short
Example
const lc = account.landing_company;

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

MarketValue

Keeps a market value and pip size

new MarketValue(value: Number, pip: Number)

Extends Immutable

Parameters
value (Number)
pip (Number)
Properties
pip_size (Number)
pip_sized (Number) : the pipsized value
display (Number) : alias for pip_size

Monetary

Keeps money related values

new Monetary(value: Number, currency: String, lang: any)

Extends Immutable

Parameters
value (Number)
currency (String)
lang (any)
Properties
value (Number)
currency (String)
display (String) : decimal value based on currency
format (String) : comma separated decimal value based on currency

Profit

Keeps money related values

new Profit(value: Number, currency: String, percentage: Number)

Extends Monetary

Parameters
value (Number)
currency (String)
percentage (Number)
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

Keeps a market value at a time

new Spot(value: Number, pip: Number, time: any)

Extends MarketValue

Parameters
value (Number)
pip (Number)
time (any)
Properties
pip_size (Number)
pip_sized (Number) : the pipsized value
time (CustomDate) : the spot time

Types

Types internally used for immutable and stream objects

Immutable

An abstract class for immutable objects

new Immutable(props: Object)
Parameters
props (Object = {}) A list of properties to add for the immutable object
Instance Members
init()

Stream

An abstract class for stream objects

new Stream(args: any)

Extends Immutable

Parameters
args (any)
Instance Members
onUpdate(callback, on_error)

Core Functionality

Cache

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.

new Cache(api: DerivAPIBasic, storage: Object)

Extends DerivAPICalls

Parameters
api (DerivAPIBasic) API instance to get data that is not cached
storage (Object) A storage instance to use for caching
Example
// 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.

new SubscriptionManager(api: any)
Parameters
api (any)
Example
// 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
Instance Members
subscribe(request)

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

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

TicksParam

Type: Object

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

BuyParam

BuyParam

Type: Object

Properties
max_price (Number?) : Maximum acceptable price for buying the contract

SellParam

SellParam

Type: Object

Properties
max_price (Number?) : Maximum acceptable price for selling the contract

ContractParam

ContractParam

Type: Object

Properties
contract_type (String)
amount (Number)
barrier (String)
barrier2 (String)
expiry_time ((Number | Date)) : epoch in seconds or Date
start_time ((Number | Date)) : epoch in seconds or Date
Currency (String?) : Default is the account currency
basis (String) : stake or payout
duration ((Number | String)) : duration with unit or duration in number
duration_unit (String?) : duration unit, required if duration is number
product_type (String?) : 'multi_barrier' or 'basic'

HistoryRange

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

API Calls

accountClosure

This call allows clients to close all their accounts (including virtual-money account). It is assumed that all their accounts (excluding virtual) have no balance left.

accountClosure(args: Object)
Parameters
args (Object = {})
Name Description
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

This call manages two-factor account authentication

accountSecurity(args: Object)
Parameters
args (Object = {})
Name Description
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

Send request to get account statistics

accountStatistics(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a list of all currently active symbols (underlying markets upon which contracts are available for trading).

activeSymbols(args: Object)
Parameters
args (Object = {})
Name Description
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

Register a new affiliate

affiliateAccountAdd(args: Object)
Parameters
args (Object = {})
Name Description
args.address_city String City name within 50 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 Within 20 characters and may not contain '+'.
args.address_state String Possible value receive from states_list call.
args.affiliate_account_add Number [Required] Must be 1
args.country String Country of legal citizenship, 2-letter country code.
args.first_name String The official first name of the affiliate. Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
args.last_name String The official last name of the affiliate. Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
args.non_pep_declaration Number 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.password String Password for the affiliate account. (Accepts any printable ASCII character. Must be between 6-50 characters, and include numbers, lowercase and uppercase letters.).
args.phone String Registered phone number of the affiliate. Starting with + followed by 8-35 digits, allowing hyphens or space.
args.req_id Number [Optional] Used to map request to response.
args.tnc_accepted Number Indicates client has agreed to the terms and conditions.
args.username String Desired username for the affiliate account. Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.

apiToken

This call manages API tokens

apiToken(args: Object)
Parameters
args (Object = {})
Name Description
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

The request for deleting an application.

appDelete(args: Object)
Parameters
args (Object = {})
Name Description
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

To get the information of the OAuth application specified by 'app_id'

appGet(args: Object)
Parameters
args (Object = {})
Name Description
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

List all of the account's OAuth applications

appList(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve details of app_markup according to criteria specified.

appMarkupDetails(args: Object)
Parameters
args (Object = {})
Name Description
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

Register a new OAuth application

appRegister(args: Object)
Parameters
args (Object = {})
Name Description
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

Update a new OAuth application

appUpdate(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a list of all available underlyings and the corresponding contract types and duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.

assetIndex(args: Object)
Parameters
args (Object = {})
Name Description
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

Authorize current WebSocket session to act on behalf of the owner of a given token. Must precede requests that need to access client account, for example purchasing and selling contracts or viewing portfolio.

authorize(args: Object)
Parameters
args (Object = {})
Name Description
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

Get user account balance

balance(args: Object)
Parameters
args (Object = {})
Name Description
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

Buy a Contract

buy(args: Object)
Parameters
args (Object = {})
Name Description
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

Buy a Contract for multiple Accounts specified by the tokens parameter. Note, although this is an authorized call, the contract is not bought for the authorized account.

buyContractForMultipleAccounts(args: Object)
Parameters
args (Object = {})
Name Description
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

Cancel contract with contract id

cancel(args: Object)
Parameters
args (Object = {})
Name Description
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

Request the cashier info for the specified type.

cashier(args: Object)
Parameters
args (Object = {})
Name Description
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

List pending transactions. This can only be used for crypto transactions.

cashierPayments(args: Object)
Parameters
args (Object = {})
Name Description
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

Request for cancelling a withdrawal. This can only be used for crypto transactions.

cashierWithdrawalCancel(args: Object)
Parameters
args (Object = {})
Name Description
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.

changeEmail

Change Email.

changeEmail(args: Object)
Parameters
args (Object = {})
Name Description
args.change_email String Must be verify or update .
args.new_email String Email address to be verified.
args.new_password String [Optional] 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). Mandatory if change_email is update and user has social login.
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.verification_code String Email verification code (received from a verify_email call, which must be done first)

changePassword

Change Password. Note: This call is only available when authenticated using an OAuth token.

changePassword(args: Object)
Parameters
args (Object = {})
Name Description
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

Update a contract condition.

contractUpdate(args: Object)
Parameters
args (Object = {})
Name Description
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

Request for contract update history.

contractUpdateHistory(args: Object)
Parameters
args (Object = {})
Name Description
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

For a given symbol, get the list of currently available contracts, and the latest barrier and duration limits for each contract.

contractsFor(args: Object)
Parameters
args (Object = {})
Name Description
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

Start copy trader bets

copyStart(args: Object)
Parameters
args (Object = {})
Name Description
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

Stop copy trader bets

copyStop(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieves a list of active copiers and/or traders for Copy Trading

copytradingList(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve performance, trading, risk and copiers statistics of trader.

copytradingStatistics(args: Object)
Parameters
args (Object = {})
Name Description
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.

cryptoConfig

The request for cryptocurrencies configuration.

cryptoConfig(args: Object)
Parameters
args (Object = {})
Name Description
args.crypto_config Number Must be 1
args.currency_code String [Optional] Cryptocurrency code. Sending request with currency_code provides crypto config for the sent cryptocurrency code only.
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.

documentUpload

Request KYC information from client

documentUpload(args: Object)
Parameters
args (Object = {})
Name Description
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.proof_of_ownership Any
args.req_id Number [Optional] Used to map request to response.

economicCalendar

Specify a currency to receive a list of events related to that specific currency. For example, specifying USD will return a list of USD-related events. If the currency is omitted, you will receive a list for all currencies.

economicCalendar(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieves the exchange rates from a base currency to all currencies supported by the system.

exchangeRates(args: Object)
Parameters
args (Object = {})
Name Description
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.
args.subscribe Number [Optional] 1 - to initiate a realtime stream of exchange rates relative to base currency.
args.target_currency String [Optional] Local currency

forget

Immediately cancel the real-time stream of messages with a specific ID.

forget(args: Object)
Parameters
args (Object = {})
Name Description
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

Immediately cancel the real-time streams of messages of given type.

forgetAll(args: Object)
Parameters
args (Object = {})
Name Description
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

Get Account Status

getAccountStatus(args: Object)
Parameters
args (Object = {})
Name Description
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.

getAccountTypes

Types of accounts available to create or link to.

getAccountTypes(args: Object)
Parameters
args (Object = {})
Name Description
args.get_account_types 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.

getAvailableAccountsToTransfer

Get Available Accounts to Transfer.

getAvailableAccountsToTransfer(args: Object)
Parameters
args (Object = {})
Name Description
args.get_available_accounts_to_transfer Number Must be 1
args.loginid String The unique identifier for this trading/wallet account.
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

This call gets the financial assessment details. The 'financial assessment' is a questionnaire that clients of certain Landing Companies need to complete, due to regulatory and KYC (know your client) requirements.

getFinancialAssessment(args: Object)
Parameters
args (Object = {})
Name Description
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

Trading and Withdrawal Limits for a given user

getLimits(args: Object)
Parameters
args (Object = {})
Name Description
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

Allows users to exclude themselves from the website for certain periods of time, or to set limits on their trading activities. This facility is a regulatory requirement for certain Landing Companies.

getSelfExclusion(args: Object)
Parameters
args (Object = {})
Name Description
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

Get User Settings (email, date of birth, address etc)

getSettings(args: Object)
Parameters
args (Object = {})
Name Description
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

Adds document information such as issuing country, id and type for identity verification processes.

identityVerificationDocumentAdd(args: Object)
Parameters
args (Object = {})
Name Description
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

The company has a number of licensed subsidiaries in various jurisdictions, which are called Landing Companies. This call will return the appropriate Landing Company for clients of a given country. The landing company may differ for Gaming contracts (Synthetic Indices) and Financial contracts (Forex, Stock Indices, Commodities).

landingCompany(args: Object)
Parameters
args (Object = {})
Name Description
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

The company has a number of licensed subsidiaries in various jurisdictions, which are called Landing Companies (and which are wholly owned subsidiaries of the Deriv Group). This call provides information about each Landing Company.

landingCompanyDetails(args: Object)
Parameters
args (Object = {})
Name Description
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

Link a wallet to a trading app.

linkWallet(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a summary of login history for user.

loginHistory(args: Object)
Parameters
args (Object = {})
Name Description
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

Logout the session

logout(args: Object)
Parameters
args (Object = {})
Name Description
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

This call allows deposit into MT5 account from Binary account.

mt5Deposit(args: Object)
Parameters
args (Object = {})
Name Description
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

Get MT5 user account settings

mt5GetSettings(args: Object)
Parameters
args (Object = {})
Name Description
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

Get list of MT5 accounts for client

mt5LoginList(args: Object)
Parameters
args (Object = {})
Name Description
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

This call creates new MT5 user, either demo or real money user.

mt5NewAccount(args: Object)
Parameters
args (Object = {})
Name Description
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 not. 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

To change passwords of the MT5 account.

mt5PasswordChange(args: Object)
Parameters
args (Object = {})
Name Description
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

This call validates the main password for the MT5 user

mt5PasswordCheck(args: Object)
Parameters
args (Object = {})
Name Description
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

To reset the password of MT5 account.

mt5PasswordReset(args: Object)
Parameters
args (Object = {})
Name Description
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

This call allows withdrawal from MT5 account to Binary account.

mt5Withdrawal(args: Object)
Parameters
args (Object = {})
Name Description
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

This call opens a new real-money account with the maltainvest Landing Company. This call can be made from a virtual-money account or real-money account at Deriv (Europe) Limited. If it is the latter, client information fields in this call will be ignored and data from your existing real-money account will be used.

newAccountMaltainvest(args: Object)
Parameters
args (Object = {})
Name Description
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.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.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

This call opens a new real-money account. This call can be made from a virtual-money or a real-money account. If it is the latter, client information fields in this call will be ignored and data from your existing real-money account will be used.

newAccountReal(args: Object)
Parameters
args (Object = {})
Name Description
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

Create a new virtual-money account.

newAccountVirtual(args: Object)
Parameters
args (Object = {})
Name Description
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

Create a new account real-money wallet account.

newAccountWallet(args: Object)
Parameters
args (Object = {})
Name Description
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

Notify the backend about a specific event.

notificationEvent(args: Object)
Parameters
args (Object = {})
Name Description
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

List all my used OAuth applications.

oauthApps(args: Object)
Parameters
args (Object = {})
Name Description
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

Creates a P2P (Peer to Peer) advert. Can only be used by an approved P2P advertiser.

p2pAdvertCreate(args: Object)
Parameters
args (Object = {})
Name Description
args.amount Number The total amount of the advert, in advertiser's account currency.
args.contact_info String [Optional] Advertiser contact information.
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 more than or equal to min_order_amount
args.min_order_amount Number Minimum allowed amount for the orders of this advert, in advertiser's account_currency . Should be less than or equal to 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.
args.payment_method String [Optional] Payment method name (deprecated).
args.payment_method_ids Any IDs of previously saved payment methods as returned from p2p_advertiser_payment_methods, only applicable for sell ads.
args.payment_method_names Any Payment method identifiers as returned from p2p_payment_methods, only applicable for buy ads.
args.rate Number Conversion rate from advertiser's account currency to local_currency . An absolute rate value (fixed), or percentage offset from current market rate (floating).
args.rate_type String Type of rate, fixed or floating.
args.req_id Number [Optional] Used to map request to response.
args.type String The advertisement represents the intention to perform this action on your Deriv account funds.

p2pAdvertInfo

Retrieve information about a P2P advert.

p2pAdvertInfo(args: Object)
Parameters
args (Object = {})
Name Description
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

Returns available adverts for use with p2p_order_create .

p2pAdvertList(args: Object)
Parameters
args (Object = {})
Name Description
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.
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

Updates a P2P advert. Can only be used by the advertiser.

p2pAdvertUpdate(args: Object)
Parameters
args (Object = {})
Name Description
args.contact_info String [Optional] Advertiser contact information.
args.delete Number [Optional] If set to 1, permanently deletes the advert.
args.description String [Optional] General information about the advert.
args.id String The unique identifier for this advert.
args.is_active Number [Optional] Activate or deactivate the advert.
args.local_currency String [Optional] Local currency for this advert.
args.max_order_amount Number [Optional] Maximum allowed amount for the orders of this advert, in advertiser's account_currency . Should be more than or equal to min_order_amount .
args.min_order_amount Number [Optional] Minimum allowed amount for the orders of this advert, in advertiser's account_currency . Should be less than or equal to max_order_amount .
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_info String [Optional] Payment instructions.
args.payment_method_ids Any [Optional] IDs of previously saved payment methods as returned from p2p_advertiser_payment_methods, only applicable for sell ads. Exisiting methods will be replaced.
args.payment_method_names Any [Optional] Payment method identifiers as returned from p2p_payment_methods, only applicable for buy ads. Exisiting methods will be replaced.
args.rate Number [Optional] Conversion rate from advertiser's account currency to local_currency . An absolute rate value (fixed), or percentage offset from current market rate (floating).
args.rate_type String [Optional] Type of rate, fixed or floating.
args.remaining_amount Number [Optional] The total available amount of the advert, in advertiser's account currency.
args.req_id Number [Optional] Used to map request to response.

p2pAdvertiserAdverts

Returns all P2P adverts created by the authorized client. Can only be used by a registered P2P advertiser.

p2pAdvertiserAdverts(args: Object)
Parameters
args (Object = {})
Name Description
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

Registers the client as a P2P advertiser.

p2pAdvertiserCreate(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve information about a P2P advertiser.

p2pAdvertiserInfo(args: Object)
Parameters
args (Object = {})
Name Description
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

Manage or list P2P advertiser payment methods.

p2pAdvertiserPaymentMethods(args: Object)
Parameters
args (Object = {})
Name Description
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

Updates and returns favourite and blocked advertisers of the current user.

p2pAdvertiserRelations(args: Object)
Parameters
args (Object = {})
Name Description
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

Update the information of the P2P advertiser for the current account. Can only be used by an approved P2P advertiser.

p2pAdvertiserUpdate(args: Object)
Parameters
args (Object = {})
Name Description
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

Creates a P2P chat for the specified order.

p2pChatCreate(args: Object)
Parameters
args (Object = {})
Name Description
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

Cancel a P2P order.

p2pOrderCancel(args: Object)
Parameters
args (Object = {})
Name Description
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

Confirm a P2P order.

p2pOrderConfirm(args: Object)
Parameters
args (Object = {})
Name Description
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

Creates a P2P order for the specified advert.

p2pOrderCreate(args: Object)
Parameters
args (Object = {})
Name Description
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.rate Number [Optional] Conversion rate from account currency to local currency, only applicable for floating rate 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 the order.

p2pOrderDispute

Dispute a P2P order.

p2pOrderDispute(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieves the information about a P2P order.

p2pOrderInfo(args: Object)
Parameters
args (Object = {})
Name Description
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

List active orders.

p2pOrderList(args: Object)
Parameters
args (Object = {})
Name Description
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.

p2pOrderReview

Creates a review for the specified order.

p2pOrderReview(args: Object)
Parameters
args (Object = {})
Name Description
args.order_id String The order identification number.
args.p2p_order_review 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.rating Number Rating for the transaction, 1 to 5.
args.recommended Any [Optional] 1 if the counterparty is recommendable to others, otherwise 0 .
args.req_id Number [Optional] Used to map request to response.

p2pPaymentMethods

List all P2P payment methods.

p2pPaymentMethods(args: Object)
Parameters
args (Object = {})
Name Description
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.

p2pPing

Keeps the connection alive and updates the P2P advertiser's online status. The advertiser will be considered offline 60 seconds after a call is made.

p2pPing(args: Object)
Parameters
args (Object = {})
Name Description
args.p2p_ping 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

Will return a list payment methods available for the given country. If the request is authenticated the client's residence country will be used.

paymentMethods(args: Object)
Parameters
args (Object = {})
Name Description
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

Saves client's payment agent details.

paymentagentCreate(args: Object)
Parameters
args (Object = {})
Name Description
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_numbers Any Payment agent's phone number(s) with country code.
args.req_id Number [Optional] Used to map request to response.
args.supported_payment_methods Any A list of supported payment methods.
args.urls Any The URL(s) of payment agent's website(s).

paymentagentDetails

Gets client's payment agent details.

paymentagentDetails(args: Object)
Parameters
args (Object = {})
Name Description
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

Will return a list of Payment Agents for a given country for a given currency. Payment agents allow users to deposit and withdraw funds using local payment methods that might not be available via the main website's cashier system.

paymentagentList(args: Object)
Parameters
args (Object = {})
Name Description
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

Payment Agent Transfer - this call is available only to accounts that are approved Payment Agents.

paymentagentTransfer(args: Object)
Parameters
args (Object = {})
Name Description
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

Initiate a withdrawal to an approved Payment Agent.

paymentagentWithdraw(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a list of available option payout currencies. If a user is logged in, only the currencies available for the account will be returned.

payoutCurrencies(args: Object)
Parameters
args (Object = {})
Name Description
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

To send the ping request to the server. Mostly used to test the connection or to keep it alive.

ping(args: Object)
Parameters
args (Object = {})
Name Description
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

Receive information about my current portfolio of outstanding options

portfolio(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a summary of account Profit Table, according to given search criteria

profitTable(args: Object)
Parameters
args (Object = {})
Name Description
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

Gets latest price for a specific contract.

proposal(args: Object)
Parameters
args (Object = {})
Name Description
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.barrier_range String [Optional] Barrier range for callputspread.
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

Get latest price (and other information) for a contract in the user's portfolio

proposalOpenContract(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve summary of client's trades and account for the Reality Check facility. A 'reality check' means a display of time elapsed since the session began, and associated client profit/loss. The Reality Check facility is a regulatory requirement for certain landing companies.

realityCheck(args: Object)
Parameters
args (Object = {})
Name Description
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

Send report to client's registered e-mail

requestReport(args: Object)
Parameters
args (Object = {})
Name Description
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

Reset Password.

resetPassword(args: Object)
Parameters
args (Object = {})
Name Description
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

This call returns a list of countries and 2-letter country codes, suitable for populating the account opening form.

residenceList(args: Object)
Parameters
args (Object = {})
Name Description
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

Used for revoking access of particular app.

revokeOauthApp(args: Object)
Parameters
args (Object = {})
Name Description
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

Sell a Contract as identified from a previous portfolio call.

sell(args: Object)
Parameters
args (Object = {})
Name Description
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

Sell contracts for multiple accounts simultaneously. Uses the shortcode response from buy_contract_for_multiple_accounts to identify the contract, and authorisation tokens to select which accounts to sell those contracts on. Note that only the accounts identified by the tokens will be affected. This will not sell the contract on the currently-authorised account unless you include the token for the current account.

sellContractForMultipleAccounts(args: Object)
Parameters
args (Object = {})
Name Description
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

This call will try to sell any expired contracts and return the number of sold contracts.

sellExpired(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieves the authorization token for the specified service.

serviceToken(args: Object)
Parameters
args (Object = {})
Name Description
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

Set account currency, this will be default currency for your account i.e currency for trading, deposit. Please note that account currency can only be set once, and then can never be changed.

setAccountCurrency(args: Object)
Parameters
args (Object = {})
Name Description
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

This call sets the financial assessment details based on the client's answers to analyze whether they possess the experience and knowledge to understand the risks involved with binary options trading.

setFinancialAssessment(args: Object)
Parameters
args (Object = {})
Name Description
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

Set Self-Exclusion (this call should be used in conjunction with get_self_exclusion)

setSelfExclusion(args: Object)
Parameters
args (Object = {})
Name Description
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

Set User Settings (this call should be used in conjunction with get_settings)

setSettings(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a summary of account transactions, according to given search criteria

statement(args: Object)
Parameters
args (Object = {})
Name Description
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

For a given country, returns a list of States of that country. This is useful to populate the account opening form.

statesList(args: Object)
Parameters
args (Object = {})
Name Description
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

Initiate a continuous stream of spot price updates for a given symbol.

ticks(args: Object)
Parameters
args (Object = {})
Name Description
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

Get historic tick data for a given symbol.

ticksHistory(args: Object)
Parameters
args (Object = {})
Name Description
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

Request back-end server epoch time.

time(args: Object)
Parameters
args (Object = {})
Name Description
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

To approve the latest version of terms and conditions.

tncApproval(args: Object)
Parameters
args (Object = {})
Name Description
args.affiliate_coc_agreement Number [Optional] For Affiliate's Code of Conduct Agreement.
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

When a virtual-money's account balance becomes low, it can be topped up using this call.

topupVirtual(args: Object)
Parameters
args (Object = {})
Name Description
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

Retrieve a list of all available underlyings and the corresponding contract types and trading duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.

tradingDurations(args: Object)
Parameters
args (Object = {})
Name Description
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

Get list of Trading Platform accounts for client

tradingPlatformAccounts(args: Object)
Parameters
args (Object = {})
Name Description
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

Deposit funds from wallet account to trading platform account

tradingPlatformDeposit(args: Object)
Parameters
args (Object = {})
Name Description
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

Change the Trading Platform investor password

tradingPlatformInvestorPasswordChange(args: Object)
Parameters
args (Object = {})
Name Description
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

Reset the investor password of a Trading Platform Account

tradingPlatformInvestorPasswordReset(args: Object)
Parameters
args (Object = {})
Name Description
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

This call creates new Trading account, either demo or real money.

tradingPlatformNewAccount(args: Object)
Parameters
args (Object = {})
Name Description
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

Change the Trading Platform password

tradingPlatformPasswordChange(args: Object)
Parameters
args (Object = {})
Name Description
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

Reset the password of a Trading Platform Account

tradingPlatformPasswordReset(args: Object)
Parameters
args (Object = {})
Name Description
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)

tradingPlatformProductListing

Get list of Trading Platform products for client

tradingPlatformProductListing(args: Object)
Parameters
args (Object = {})
Name Description
args.app_id Any [Optional] Specific application app_id .
args.country_code String [Optional] Country of legal citizenship, 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.req_id Number [Optional] Used to map request to response.
args.trading_platform_product_listing Number Must be 1.

tradingPlatformWithdrawal

This call allows withdrawal from Trading account to a wallet account.

tradingPlatformWithdrawal(args: Object)
Parameters
args (Object = {})
Name Description
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

Get the list of servers for a trading platform.

tradingServers(args: Object)
Parameters
args (Object = {})
Name Description
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

Receive a list of market opening times for a given date.

tradingTimes(args: Object)
Parameters
args (Object = {})
Name Description
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

Subscribe to transaction notifications

transaction(args: Object)
Parameters
args (Object = {})
Name Description
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

This call allows transfers between accounts held by a given user. Transfer funds between your fiat and cryptocurrency accounts (for a fee). Please note that account_from should be same as current authorized account.

transferBetweenAccounts(args: Object)
Parameters
args (Object = {})
Name Description
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

Verify an email address for various purposes. The system will send an email to the address containing a security code for verification.

verifyEmail(args: Object)
Parameters
args (Object = {})
Name Description
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

Request server status.

websiteStatus(args: Object)
Parameters
args (Object = {})
Name Description
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

new InMemory()

TransactionParams

TransactionParams

Type: Object

ExpiryType

ExpiryType

Type: Object

Properties
duration (DurationRange)
barriers (Object)

ContractCategory

ContractCategory

Type: Object

Properties
name (FullName)
has_end_time (Boolean) : Is end time available for the contract (hardcoded X) )
contract_types (Array<String>)
bases (Array<String>)
forward_starting (Object)
expiry_types (ExpiryType)