TrueX REST API (1.0.0)
This API allows clients to interact with the TrueX trading platform for order management, market data retrieval, and account information.
Certain API requests must be authenticated using HMAC-SHA256 signature authentication.
- 📖 Full API Documentation: https://docs.truex.co/
- 📧 Support: support@truex.co
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/
https://prod.truex.co/
- Mock server
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order/active
https://prod.truex.co/api/v1/order/active
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.truemarkets.co/_mock/apis/cefi/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'
Successful operation.
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.
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.
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.
Order quantity that has been acknowledge by the exchange but is not yet trading.
Volume weighted average price calculation for all executions on the order.
[ { "id": "0987654321", "status": "ACTIVE", "order_info": { … }, "modify_info": { … }, "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" } ]
- Mock server
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order
https://prod.truex.co/api/v1/order
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order?query=string&skip=0&size=10' \
-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'
Successful operation.
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.
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.
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.
Order quantity that has been acknowledge by the exchange but is not yet trading.
Volume weighted average price calculation for all executions on the order.
[ { "id": "0987654321", "status": "ACTIVE", "order_info": { … }, "modify_info": { … }, "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" } ]
Order new request context.
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.
The client ID the order will be entered on behalf of.
The ID of the instrument the order will transact in.
The amount of base asset the order is requesting to tranasct.
The highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders.
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.
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.
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.
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, theIOC
order will be canceled immediately. If the TIF is omitted, the order will default toGTC
.
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.
The amount of fee asset being held by the order. This is not necessarily the fee charge associated with the order.
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.
- Mock server
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order
https://prod.truex.co/api/v1/order
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.truemarkets.co/_mock/apis/cefi/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": {
"msg_id": "123456789",
"parent_id": "0",
"client_id": "5432167890",
"instrument_id": "987654321",
"qty": "10.5",
"price": "75.50",
"flags": [
"USE_AGGRESSIVE_PRICING"
],
"side": "BUY",
"type": "LIMIT",
"tif": "GTC",
"exec_inst_flags": [
"ALO"
],
"hold_fee_rate": "0.002",
"stp": "NONE"
}
}'
Successful operation.
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.
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.
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.
Order quantity that has been acknowledge by the exchange but is not yet trading.
{ "id": "0987654321", "status": "ACTIVE", "order_info": { "msg_id": "123456789", "parent_id": "0", "client_id": "5432167890", "instrument_id": "987654321", "qty": "10.5", "price": "75.50", "flags": [ … ], "side": "BUY", "type": "LIMIT", "tif": "GTC", "exec_inst_flags": [ … ], "hold_fee_rate": "0.002", "stp": "NONE" }, "modify_info": { "msg_id": "123456789", "parent_id": "0", "client_id": "5432167890", "prev_modify": "0", "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" }
Order modify request context.
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.
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.
The client ID the modification will be entered on behalf of.
The new amount of base asset the order is requesting to tranasct.
The new highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders.
- Mock server
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order
https://prod.truex.co/api/v1/order
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
https://docs.truemarkets.co/_mock/apis/cefi/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": {
"msg_id": "123456789",
"parent_id": "0",
"client_id": "5432167890",
"prev_modify": "0",
"new_qty": "1.5",
"new_price": "75.50",
"new_type": "MARKET"
}
}'
Successful operation.
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.
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.
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.
Order quantity that has been acknowledge by the exchange but is not yet trading.
{ "id": "0987654321", "status": "ACTIVE", "order_info": { "msg_id": "123456789", "parent_id": "0", "client_id": "5432167890", "instrument_id": "987654321", "qty": "10.5", "price": "75.50", "flags": [ … ], "side": "BUY", "type": "LIMIT", "tif": "GTC", "exec_inst_flags": [ … ], "hold_fee_rate": "0.002", "stp": "NONE" }, "modify_info": { "msg_id": "123456789", "parent_id": "0", "client_id": "5432167890", "prev_modify": "0", "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" }
- Mock server
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order/{ref_order_id}
https://prod.truex.co/api/v1/order/{ref_order_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://docs.truemarkets.co/_mock/apis/cefi/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'
Successful operation.
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.
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.
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.
Order quantity that has been acknowledge by the exchange but is not yet trading.
{ "id": "0987654321", "status": "ACTIVE", "order_info": { "msg_id": "123456789", "parent_id": "0", "client_id": "5432167890", "instrument_id": "987654321", "qty": "10.5", "price": "75.50", "flags": [ … ], "side": "BUY", "type": "LIMIT", "tif": "GTC", "exec_inst_flags": [ … ], "hold_fee_rate": "0.002", "stp": "NONE" }, "modify_info": { "msg_id": "123456789", "parent_id": "0", "client_id": "5432167890", "prev_modify": "0", "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" }
- Mock server
https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order/trade
https://prod.truex.co/api/v1/order/trade
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.truemarkets.co/_mock/apis/cefi/rest/v1/api/v1/order/trade?size=string&skip=string×tamp=1741523275598727336' \
-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'
[ { "client_id": "1234576970", "instrument_id": "1234576970", "order_id": "1234576970", "trade_price": "75000.50", "trade_qty": "100.00", "trade_fee_rate": "0.0005", "liq_flag": "TAKER", "match_id": "1234576970", "timestamp": "1740740509058376312" } ]