Trade and data level properties
Every session (see core API concepts) associated with a logged in user is assigned with a capability comprising two properties.
The TradeLevel property can be either:
- OrdersOnly (default)
The DataLevel property can be either:
- Standard (default)
Only one session (per user) can have the upgraded trade level of FullTradingAndChat and only one session can have the upgraded data level of Premium. If the trade level or data level is upgraded for one session associated with a user, all other sessions associated with the same user will have their trade or data level demoted to the default level.
Trade level usage
Trade level affects how your application is able to trade.
If trade level is OrderOnly, your application is only able to place orders.
If trade level is FullTradingAndChat, your application is also able to trade on quote.
Setting trade level to FullTradingAndChat has the effect that:
- Prices become real time, if you are subscribed for realtime quotes;
- A price subscription for FxOptions can return a QuoteId (sample);
- It is subsequently possible to execute a trade by posting this QuoteId to the trade/positions endpoint.
Monitoring and modifying and the trade level
If your application needs the elevated trade level, it must do two things:
- Set up a subscription to listen for changes on the current session (e.g. upgrade or downgrade of the trade level)
- Request capabilities = upgrade trade level.
It is also possible to poll for current capabilities, but it is recommended to set up a subscription to get notified as soon as possible.
Only requesting the required levels - and not setting up a subscription to listen for changes - is not recommended, since you (the client application) will be unaware when the capabilities are downgraded to the default ones, which typically happens if the same user creates a new (user) session and requests full trading capabilities on that one.
The consequence is that the client application will be working with wrong assumptions and some requests will be rejected or data is (unexpectedly) delayed.
For example, to upgrade your session in order to leverage real-time market data subscriptions, send the below
PATCH request in order to set the TradeLevel to
To confirm the session's extended capabilities, see the below section.
Monitoring Trade and Data levels
A session event subscription will notify the client application (over the streaming channel) when changes to trade and data level occurs. The current state of the session is also available in a GET call.
Monitor continuously: Session Event Subscription
Create a subscription to get changes to the session as quick as possible.
The subscription will return the current levels in the response and deliver any additional updates on the streaming channel.
See the endpoint documentation for more details on this. Also see the streaming documentation for how subscriptions work, which will also explain how context ids are defined (and how they together with sessions define streaming sessions).
Modifications to the session will look like this:
Since changes like the above might not happen that often (depending on the user pattern), it is very likely to see heartbeat messages on the streaming channel:
Monitor intermittently: Get Session Capabilities
Make a single GET request to get the current state of the session
With the response showing the sesssion's current capabilities:
An example response containing extended capabilities