For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/institutional/add-orders-cefi.md.

Create order

POST
/v1/cefi/orders

Create a new order for a specific instrument.

Authorization

headerx-truex-auth-token<token>

Legacy authentication, being phased out in favour of JWT. Clients must compute and send an HMAC signature in x-truex-auth-signature.

Compute the payload exactly as:

timestamp + method + path + body

Then compute the signature as:

Base64( HMAC_SHA256(secret, payload) )

Rules:

  • timestamp is x-truex-auth-timestamp in seconds since Unix epoch.
  • timestamp must be no older than 15 seconds and no more than 1 second in the future.
  • method is uppercase HTTP method (GET, POST, DELETE, etc.).
  • path is everything after the domain, including the leading / and the raw query string exactly as sent, still percent-encoded (e.g. /v1/cefi/orders/EXT-1?id_type=client). Leave out the ? when the query is empty.
  • Signatures over the path without its query are still accepted while signers move over.
  • body is the exact raw request body string. Use an empty string for requests with no body.

Example payload:

  • 1700000000POST/v1/cefi/orders{"client_id":"7","instrument_id":"1","qty":"1","price":"100"}

Example signature (shell):

  • printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" -binary | base64

Required headers:

  • x-truex-auth-token: The ID of the HMAC key being used (API key).
  • x-truex-auth-signature: The signature generated from processing the payload with the HMAC key.
  • x-truex-auth-timestamp: Current time as seconds since epoch.
  • x-truex-auth-userid: Client identifier, for organization keys. It is not signed, so keys that act on behalf of any client ignore it and name the client in the query or body.

Header Parameters

x-truex-auth-userid?string

HMAC only. The client the request acts for. Omit it with a JWT, which carries your client id.

x-truex-auth-timestamp*string

Timestamp when request was made in seconds since epoch. Must be no older than 15 seconds and no more than 1 second in the future. Required with both JWT and HMAC authentication; it guards against replayed requests.

x-truex-auth-token?string

HMAC only. The UUID affiliated with the HMAC key. Omit it with a JWT.

x-truex-auth-signature?string

HMAC only. The computed HMAC signature. Omit it with a JWT.

Request Body

Order new request context.

application/json
  1. body
external_id?string

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

  • UUID version 4 in its human readable form, with hypens, and in lowercase.
  • ASCII character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (_), period (.), and tilde (~).
info*

Response Body

Successful operation.

application/json
  1. response
id?string
status?string

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.
Value in"INITIALIZED""NEW_PENDING""REJECTED""ACTIVE""FILLED""CANCEL_PENDING""CANCELED""MODIFY_PENDING"
order_info?
modify_info?
external_id?string

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

  • UUID version 4 in its human readable form, with hypens, and in lowercase.
  • ASCII character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (_), period (.), and tilde (~).
ref_external_id?string

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

  • UUID version 4 in its human readable form, with hypens, and in lowercase.
  • ASCII character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (_), period (.), and tilde (~).
pending_qty?string

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

leaves_qty?string

Order quantity that is currently active in the market.

executed_qty?string

Amount of quantity currently executed.

executed_vwap?string

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

Example Request
curl -X POST 'https://api.truex.co/v1/cefi/orders' \  -H 'x-truex-auth-timestamp: string' \  -H 'Content-Type: application/json' \  -d '{  "info": {    "client_id": "78901949710204932",    "instrument_id": "78901949723181070",    "qty": "0.00145",    "price": "111067",    "side": "BUY",    "type": "LIMIT"  }}'
Example Response
{  "id": "799477895858487977",  "status": "ACTIVE",  "order_info": {    "msg_id": "799477895858487977",    "parent_id": "432351810263056385",    "client_id": "78901949710204932",    "instrument_id": "78901949723181070",    "qty": "0.00145",    "price": "111067",    "flags": [      "USE_AGGRESSIVE_PRICING"    ],    "side": "BUY",    "type": "LIMIT",    "tif": "GTC",    "exec_inst_flags": [      "ALO"    ],    "hold_fee_bps": "20",    "hold_fee_rate": "0.002",    "stp": "NONE"  },  "modify_info": {    "msg_id": "1",    "parent_id": "1",    "client_id": "1",    "prev_modify": "0",    "new_qty": "0",    "new_price": "0",    "new_type": "MARKET"  },  "external_id": "EXT-ORDER-123",  "ref_external_id": "REF-EXT-ORDER-123",  "pending_qty": "0",  "leaves_qty": "0.00145",  "executed_qty": "0.00239",  "executed_vwap": "111050.5"}