Create order
Last updated
Last updated
To place an order, grab the nonce and msg hash from the nonce api orders/nonce/ and provide them to the create order api /orders/create/.
Note: You will need to include the JWT Auth token to request headers to access this endpoint. To get the JWT Auth Token, refer the login section of this document.
If you are affiliated with the tanX organization, please ensure that you add the organization_key and api_key to the request body in both the nonce and create endpoints. This field is entirely optional. To obtain these keys, please reach out to tanX at support@tanx.fi.
Before creating a new order, youโd be required to obtain a nonce and a msg hash by making use of this endpoint. Please note that this is a Private ๐ route which means it needs to be authorized by the account initiating this request.
Field | Type | Mandatory | Description |
---|---|---|---|
Create a new order. (Private ๐)
Before creating a new order, youโd be required to obtain a nonce by making use of this endpoint. Please note that this is a Private ๐ route which means it needs to be authorized by the account initiating this request.
To sign the msg hash obtained after accessing the nonce API, use the NodeJs SDK signMsgHash function.
After successfully generating the signature, you may send it together with additional parameters to create the order, as shown below.
Field | Type | Mandatory |
---|---|---|
market
STRING
YES
ord_type
STRING
YES
allowed values: [limit, market, stop_limit, limit_maker(post-only order) ].
To place a post-only order, send limit_maker as the order type.
price
FLOAT
OPTIONAL
It is required for creating limit order
side
STRING
YES
allowed values [buy, sell]
volume
FLOAT
YES
stop_price
FLOAT
OPTIONAL
It is required for creating stop limit order
msg_hash
STRING
YES
signature (both r & s)
STRING
YES
nonce
INTEGER
YES