This is the public interface of the trading platform, to be used to develop trading screens.
Before any data can be retrieved from the api, a login must be made. A login is per client, and subsequent calls to the api will only return information pertinent to that particular client. In order to achieve this, a session-id cookie is returned with the login response. It must be returned in the request header of all subsequent requests. In the future there may be an optional request parameter version of this for non browser clients.
method: POST
url: /ts/login
body:
{
"username":"[username]",
"password":"[p455w0rd]",
"market_id":"[id]"
}
{"result":"success"} or {"result":"error","errors":"[Reason]"}
The market snapshot is the current state of the market at any given time. This lookup is expensive, and should only be performed once after login. This data can be used to construct an orders grid with full depth.
method: GET
url: /ts/market_snapshot?market_id=[id]
The response to this request is a JSON data structure called the snapshot. A snapshot consists of a market, a list of products and a list of orders.
A list of all the products that are available to trade in the market. A product consists of an id and a symbol.
A list of all of the orders currently in the live market. An order consists of a market_id, product_id, side (buy or sell), quantity and price.
method: GET
url: /ts/market_update?market_id=[id]
The response to this request is a JSON data structure called the market_update. A market_update consists of a list of orders and a list of fills.
A list of all of the orders that have been created since the last time this method was called (or since login if it has not previously been called). An order consists of a market_id, product_id, side (buy or sell), quantity and price.
A list of all the trades that have occured since the last time this method was called. A trade consists of an price, product_id, quantity and timestamp which is a long integer that can be used to order trades.
method: POST
url: /ts/orders
body:
{"order":{
"market_id":"[id]",
"product_id":"[id]",
"side":"[buy/sell]",
"quantity":"[quantity]",
"price":"[price]"
}}
{"result":"success"}
This is the public interface for creating and managing products.
This is the public interface for creating and managing company and user accounts.
This is the public interface for setting up clearing, margins and limits.
For hosted accounts this is the public interface to modify your user's trading screen.
Sign up for our newsletter and get updates and early access.