TrueX REST API (1.0.0)

Overview

This API allows clients to interact with the TrueX trading platform for order management, market data retrieval, and account information.

Base URL

https://prod.truex.co/api/v1/

Authentication

Certain API requests must be authenticated using HMAC-SHA256 signature authentication.

Download OpenAPI description
Languages
Servers
Mock server
https://docs.truex.co/_mock/rest/v1/
https://prod.truex.co/

Assets

Operations

Instruments

Operations

Market Data

Operations

Clients

Operations

Orders

Operations

Active orders

Request

Query for orders currently active on the exchange. An order ID may be supplied to query for a specific order, if this query parameter is not supplied then all active orders will be returned.

Query
idstring

ID of order to query for.

Headers
x-truex-auth-useridstringrequired

Client identifier.

x-truex-auth-timestampstringrequired

Timestamp when request was made in seconds since epoch.

x-truex-auth-tokenstringrequired

The UUID affiliated with the HMAC key.

x-truex-auth-signaturestringrequired

The computed HMAC signature.

curl -i -X GET \
  'https://docs.truex.co/_mock/rest/v1/api/v1/order/active?id=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -H 'x-truex-auth-signature: string' \
  -H 'x-truex-auth-timestamp: string' \
  -H 'x-truex-auth-token: string' \
  -H 'x-truex-auth-userid: string'

Responses

Successful operation.

Bodyapplication/jsonArray [
idstring
Example: "0987654321"
statusstring

The current status of the order.

  • INITIALIZED Order has been created, but not sent yet.
  • NEW_PENDING Order has been sent, but not confirmed by the exchange or downstream process.
  • REJECTED An order setting or market condition prevents the order from getting processed.
  • ACTIVE The order was accepted by the system and open to trading (order and market conditions permitting).
  • FILLED The entire order traded.
  • CANCEL_PENDING Indicates a cancel request was received and being processed.
  • CANCELED The order was canceled from a cancel request, order conditions, or market conditions.
  • MODIFY_PENDING Indicates a modification request was received and being processed.
Enum"INITIALIZED""NEW_PENDING""REJECTED""ACTIVE""FILLED""CANCEL_PENDING""CANCELED""MODIFY_PENDING"
Example: "ACTIVE"
orderobject(OrderInfo)
modifyobject(ModifyInfo)
external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "EXT-ORDER-123"
ref_external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "REF-EXT-ORDER-123"
pending_qtystring

Order quantity that has been acknowledge by the exchange but is not yet trading.

Example: "1"
leaves_qtystring

Order quantity that is currently active in the market.

Example: "100"
exeuted_qtystring

Amount of quantity currently executed.

Example: "100"
executed_vwapstring

Volume weighted average price calculation for all executions on the order.

Example: "897.321"
]
Response
application/json
[ { "id": "0987654321", "status": "ACTIVE", "order": {}, "modify": {}, "external_id": "EXT-ORDER-123", "ref_external_id": "REF-EXT-ORDER-123", "pending_qty": "1", "leaves_qty": "100", "exeuted_qty": "100", "executed_vwap": "897.321" } ]

All orders

Request

Query for all orders placed on the exchange within the last 24 hours. A filter can be provided to limit the results.

Query
querystring

A serialized JSON object containing filter parameters. Filter orders by property, using $eq, $lt, $gt, $gte, $lte operators.

Examples:
query={"columns":[{"name":"order_info.side","filter":[{"op":"$eq","value":["BUY"]}]}]}
skipinteger

The number of items to skip for pagination.

Default 0
Examples:
skip=10
sizeinteger

The number of items to return.

Default 10
Examples:
size=10
Headers
x-truex-auth-useridstringrequired

Client identifier.

x-truex-auth-timestampstringrequired

Timestamp when request was made in seconds since epoch.

x-truex-auth-tokenstringrequired

The UUID affiliated with the HMAC key.

x-truex-auth-signaturestringrequired

The computed HMAC signature.

curl -i -X GET \
  'https://docs.truex.co/_mock/rest/v1/api/v1/order?query=string&size=10&skip=0' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -H 'x-truex-auth-signature: string' \
  -H 'x-truex-auth-timestamp: string' \
  -H 'x-truex-auth-token: string' \
  -H 'x-truex-auth-userid: string'

Responses

Successful operation.

Bodyapplication/jsonArray [
idstring
Example: "0987654321"
statusstring

The current status of the order.

  • INITIALIZED Order has been created, but not sent yet.
  • NEW_PENDING Order has been sent, but not confirmed by the exchange or downstream process.
  • REJECTED An order setting or market condition prevents the order from getting processed.
  • ACTIVE The order was accepted by the system and open to trading (order and market conditions permitting).
  • FILLED The entire order traded.
  • CANCEL_PENDING Indicates a cancel request was received and being processed.
  • CANCELED The order was canceled from a cancel request, order conditions, or market conditions.
  • MODIFY_PENDING Indicates a modification request was received and being processed.
Enum"INITIALIZED""NEW_PENDING""REJECTED""ACTIVE""FILLED""CANCEL_PENDING""CANCELED""MODIFY_PENDING"
Example: "ACTIVE"
orderobject(OrderInfo)
modifyobject(ModifyInfo)
external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "EXT-ORDER-123"
ref_external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "REF-EXT-ORDER-123"
pending_qtystring

Order quantity that has been acknowledge by the exchange but is not yet trading.

Example: "1"
leaves_qtystring

Order quantity that is currently active in the market.

Example: "100"
exeuted_qtystring

Amount of quantity currently executed.

Example: "100"
executed_vwapstring

Volume weighted average price calculation for all executions on the order.

Example: "897.321"
]
Response
application/json
[ { "id": "0987654321", "status": "ACTIVE", "order": {}, "modify": {}, "external_id": "EXT-ORDER-123", "ref_external_id": "REF-EXT-ORDER-123", "pending_qty": "1", "leaves_qty": "100", "exeuted_qty": "100", "executed_vwap": "897.321" } ]

Create order

Request

Create a new order for a specific instrument.

Headers
x-truex-auth-useridstringrequired

Client identifier.

x-truex-auth-timestampstringrequired

Timestamp when request was made in seconds since epoch.

x-truex-auth-tokenstringrequired

The UUID affiliated with the HMAC key.

x-truex-auth-signaturestringrequired

The computed HMAC signature.

Bodyapplication/jsonrequired

Order new request context.

external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).

  • ASCII character string that does not exceed 18 characters.

Example: "321e7654-e89b-42d4-a456-426614174000"
infoobject(OrderInfo)required
info.​client_idstringrequired

The client ID the order will be entered on behalf of.

Example: "5432167890"
info.​instrument_idstringrequired

The ID of the instrument the order will transact in.

Example: "0987654321"
info.​qtystringrequired

The amount of base asset the order is requesting to tranasct.

Example: "10.5"
info.​pricestringrequired

The highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders.

Example: "75.50"
info.​sidestringrequired

Side of order, can be BUY or SELL

  • BUY Provide trader's quote asset to acquire the base asset.
  • SELL Provide trader's base asset to acquire the quote asset.
Enum"BUY""SELL"
Example: "BUY"
info.​typestringrequired

Type of order, can be LIMIT, MARKET.

  • LIMIT A specified limit price sets the maximum amount in quote currency units that the order will exchange to acquire the base currency.
  • MARKET The order uses the TrueX market price at time of order entry plus/minus (for buy/sell respectively) the max price allowed by the price band risk limits for the instrument.
Enum"LIMIT""MARKET"
Example: "LIMIT"
info.​tifstring

The "Time In Force" (TIF) of an order indicates how long the order will remain active before being canceled, can be GTC, IOC.

  • GTC (Good-Till-Cancel) Order remains active for up to 30 days from the time of entry.
  • IOC (Immediate-Or-Cancel) Order will execute as much of the order as possible up to the requested price, provided there are existing orders that match or improve upon the price. An IOC order will cancel any unfilled quantity back to the requestor. If no matching orders are found, the IOC order will be canceled immediately. If the TIF is omitted, the order will default to GTC.
Enum"GTC""IOC"
Example: "GTC"
info.​flagsArray of stringsunique

General order flags that can be combined and used together.

  • USE_AGGRESIVE_PRICING Applicable to market orders only. When enabled, the exchange calculates a price for the market order that is more aggressive than the current best bid or offer. This is useful when prioritizing liquidity capture over minimizing price slippage.
Items Value"USE_AGGRESSIVE_PRICING"
Example: ["USE_AGGRESSIVE_PRICING"]
info.​exec_inst_flagsArray of stringsunique

Execution specific instructions that can be combined and used together.

  • ALO Ensures the order adds liquidity to the market rather than removing it. When this flag is enabled, the order will only be placed if it would not immediately execute against the current best bid or offer. If the order would otherwise result in an immediate match, it will be canceled or adjusted based on the exchange's rules.
Items Value"ALO"
Example: ["ALO"]
info.​stpstring

Order level self trade protection instruction.

  • INVALID Order level self trade protections are in an invalid state and may result in order rejection.
  • NONE No self trade protections are enabled for this order.
  • CANCEL_AGGRESSIVE This order will be canceled in the result of a self trade.
  • CANCEL_BOTH This order and the resting order will both be canceled in the result of a self trade.
Enum"INVALID""NONE""CANCEL_AGGRESSIVE""CANCEL_BOTH"
Example: "NONE"
curl -i -X POST \
  https://docs.truex.co/_mock/rest/v1/api/v1/order \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -H 'x-truex-auth-signature: string' \
  -H 'x-truex-auth-timestamp: string' \
  -H 'x-truex-auth-token: string' \
  -H 'x-truex-auth-userid: string' \
  -d '{
    "external_id": "321e7654-e89b-42d4-a456-426614174000",
    "info": {
      "client_id": "5432167890",
      "instrument_id": "0987654321",
      "qty": "10.5",
      "price": "75.50",
      "side": "BUY",
      "type": "LIMIT",
      "tif": "GTC",
      "flags": [
        "USE_AGGRESSIVE_PRICING"
      ],
      "exec_inst_flags": [
        "ALO"
      ],
      "stp": "NONE"
    }
  }'

Responses

Successful operation.

Bodyapplication/json
idstring
Example: "0987654321"
statusstring

The current status of the order.

  • INITIALIZED Order has been created, but not sent yet.
  • NEW_PENDING Order has been sent, but not confirmed by the exchange or downstream process.
  • REJECTED An order setting or market condition prevents the order from getting processed.
  • ACTIVE The order was accepted by the system and open to trading (order and market conditions permitting).
  • FILLED The entire order traded.
  • CANCEL_PENDING Indicates a cancel request was received and being processed.
  • CANCELED The order was canceled from a cancel request, order conditions, or market conditions.
  • MODIFY_PENDING Indicates a modification request was received and being processed.
Enum"INITIALIZED""NEW_PENDING""REJECTED""ACTIVE""FILLED""CANCEL_PENDING""CANCELED""MODIFY_PENDING"
Example: "ACTIVE"
orderobject(OrderInfo)
modifyobject(ModifyInfo)
external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "EXT-ORDER-123"
ref_external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "REF-EXT-ORDER-123"
pending_qtystring

Order quantity that has been acknowledge by the exchange but is not yet trading.

Example: "1"
leaves_qtystring

Order quantity that is currently active in the market.

Example: "100"
exeuted_qtystring

Amount of quantity currently executed.

Example: "100"
executed_vwapstring

Volume weighted average price calculation for all executions on the order.

Example: "897.321"
Response
application/json
{ "id": "0987654321", "status": "ACTIVE", "order": { "client_id": "5432167890", "instrument_id": "0987654321", "qty": "10.5", "price": "75.50", "side": "BUY", "type": "LIMIT", "tif": "GTC", "flags": [], "exec_inst_flags": [], "stp": "NONE" }, "modify": { "client_id": "5432167890", "new_qty": "1.5", "new_price": "75.50", "new_type": "MARKET" }, "external_id": "EXT-ORDER-123", "ref_external_id": "REF-EXT-ORDER-123", "pending_qty": "1", "leaves_qty": "100", "exeuted_qty": "100", "executed_vwap": "897.321" }

Modify order

Request

Modify an existing active order request.

Headers
x-truex-auth-useridstringrequired

Client identifier.

x-truex-auth-timestampstringrequired

Timestamp when request was made in seconds since epoch.

x-truex-auth-tokenstringrequired

The UUID affiliated with the HMAC key.

x-truex-auth-signaturestringrequired

The computed HMAC signature.

Bodyapplication/jsonrequired

Order modify request context.

idstring

The internal order ID of the order to be modified. This is the id that was set by TrueX and should be a purely numeric string.

Example: "1159718398822187014"
external_idstring

The external ID for the modification request set by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "123e7654-e89b-42d4-a456-426614174000"
infoobject(ModifyInfo)required
info.​client_idstringrequired

The client ID the modification will be entered on behalf of.

Example: "5432167890"
info.​new_qtystringrequired

The new amount of base asset the order is requesting to tranasct.

Example: "1.5"
info.​new_pricestringrequired

The new highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders.

Example: "75.50"
info.​new_typestring

LIMIT orders may be converted to MARKET orders. The new MARKET order will immediately execute against the resting side of the order book providing there is available liquidity on the contra side of the request.

Value"MARKET"
Example: "MARKET"
curl -i -X PATCH \
  https://docs.truex.co/_mock/rest/v1/api/v1/order \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -H 'x-truex-auth-signature: string' \
  -H 'x-truex-auth-timestamp: string' \
  -H 'x-truex-auth-token: string' \
  -H 'x-truex-auth-userid: string' \
  -d '{
    "id": "1159718398822187014",
    "external_id": "123e7654-e89b-42d4-a456-426614174000",
    "info": {
      "client_id": "5432167890",
      "new_qty": "1.5",
      "new_price": "75.50",
      "new_type": "MARKET"
    }
  }'

Responses

Successful operation.

Bodyapplication/json
idstring
Example: "0987654321"
statusstring

The current status of the order.

  • INITIALIZED Order has been created, but not sent yet.
  • NEW_PENDING Order has been sent, but not confirmed by the exchange or downstream process.
  • REJECTED An order setting or market condition prevents the order from getting processed.
  • ACTIVE The order was accepted by the system and open to trading (order and market conditions permitting).
  • FILLED The entire order traded.
  • CANCEL_PENDING Indicates a cancel request was received and being processed.
  • CANCELED The order was canceled from a cancel request, order conditions, or market conditions.
  • MODIFY_PENDING Indicates a modification request was received and being processed.
Enum"INITIALIZED""NEW_PENDING""REJECTED""ACTIVE""FILLED""CANCEL_PENDING""CANCELED""MODIFY_PENDING"
Example: "ACTIVE"
orderobject(OrderInfo)
modifyobject(ModifyInfo)
external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "EXT-ORDER-123"
ref_external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "REF-EXT-ORDER-123"
pending_qtystring

Order quantity that has been acknowledge by the exchange but is not yet trading.

Example: "1"
leaves_qtystring

Order quantity that is currently active in the market.

Example: "100"
exeuted_qtystring

Amount of quantity currently executed.

Example: "100"
executed_vwapstring

Volume weighted average price calculation for all executions on the order.

Example: "897.321"
Response
application/json
{ "id": "0987654321", "status": "ACTIVE", "order": { "client_id": "5432167890", "instrument_id": "0987654321", "qty": "10.5", "price": "75.50", "side": "BUY", "type": "LIMIT", "tif": "GTC", "flags": [], "exec_inst_flags": [], "stp": "NONE" }, "modify": { "client_id": "5432167890", "new_qty": "1.5", "new_price": "75.50", "new_type": "MARKET" }, "external_id": "EXT-ORDER-123", "ref_external_id": "REF-EXT-ORDER-123", "pending_qty": "1", "leaves_qty": "100", "exeuted_qty": "100", "executed_vwap": "897.321" }

Cancel order

Request

Begins the cancellation process of an existing active order from the exchange. N.B. it is still possible to recieve trades on the order that is being canceled.

Path
ref_order_idstringrequired

ID of order to cancel.

Headers
x-truex-auth-useridstringrequired

Client identifier.

x-truex-auth-timestampstringrequired

Timestamp when request was made in seconds since epoch.

x-truex-auth-tokenstringrequired

The UUID affiliated with the HMAC key.

x-truex-auth-signaturestringrequired

The computed HMAC signature.

curl -i -X DELETE \
  'https://docs.truex.co/_mock/rest/v1/api/v1/order/{ref_order_id}' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -H 'x-truex-auth-signature: string' \
  -H 'x-truex-auth-timestamp: string' \
  -H 'x-truex-auth-token: string' \
  -H 'x-truex-auth-userid: string'

Responses

Successful operation.

Bodyapplication/json
idstring
Example: "0987654321"
statusstring

The current status of the order.

  • INITIALIZED Order has been created, but not sent yet.
  • NEW_PENDING Order has been sent, but not confirmed by the exchange or downstream process.
  • REJECTED An order setting or market condition prevents the order from getting processed.
  • ACTIVE The order was accepted by the system and open to trading (order and market conditions permitting).
  • FILLED The entire order traded.
  • CANCEL_PENDING Indicates a cancel request was received and being processed.
  • CANCELED The order was canceled from a cancel request, order conditions, or market conditions.
  • MODIFY_PENDING Indicates a modification request was received and being processed.
Enum"INITIALIZED""NEW_PENDING""REJECTED""ACTIVE""FILLED""CANCEL_PENDING""CANCELED""MODIFY_PENDING"
Example: "ACTIVE"
orderobject(OrderInfo)
modifyobject(ModifyInfo)
external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "EXT-ORDER-123"
ref_external_idstring

A unique identifier created by the client. Must be in one the follower formats:

  • UUID version 4 in its human readable form, with hypens, and in lowercase (e.g. 2adc09dd-d49f-41da-b3b8-30d01bb350fe).
  • ASCII character string that does not exceed 18 characters.
Example: "REF-EXT-ORDER-123"
pending_qtystring

Order quantity that has been acknowledge by the exchange but is not yet trading.

Example: "1"
leaves_qtystring

Order quantity that is currently active in the market.

Example: "100"
exeuted_qtystring

Amount of quantity currently executed.

Example: "100"
executed_vwapstring

Volume weighted average price calculation for all executions on the order.

Example: "897.321"
Response
application/json
{ "id": "0987654321", "status": "ACTIVE", "order": { "client_id": "5432167890", "instrument_id": "0987654321", "qty": "10.5", "price": "75.50", "side": "BUY", "type": "LIMIT", "tif": "GTC", "flags": [], "exec_inst_flags": [], "stp": "NONE" }, "modify": { "client_id": "5432167890", "new_qty": "1.5", "new_price": "75.50", "new_type": "MARKET" }, "external_id": "EXT-ORDER-123", "ref_external_id": "REF-EXT-ORDER-123", "pending_qty": "1", "leaves_qty": "100", "exeuted_qty": "100", "executed_vwap": "897.321" }

Balances

Operations

Transfers

Operations