API Reference

Create Order v1.0 (Old)

Creates a single order for Spot Trading on the Exchange. When an order is placed, the required funds from your account will be ringfenced for the duration of the order

📘

We provide two endpoints for creating spot trading orders:

  1. Legacy Endpoint: /api/v1/spot/order
  2. New Endpoint: /api/v1.1/spot/order

Key Differences:

  1. Market Order Support:

    • v1: Supports specifying only the cash amount for market buy orders and the quantity for market sell orders
    • v1.1: Supports specifying both the cash amount and the quantity for market orders, regardless of whether it's a buy or sell order
  2. Quantity and Amount:

    • v1: Uses a single 'quantity' parameter for specifying order size
    • v1.1: Splits the order size into separate 'quantity' and 'amount' parameters

Recommendation:
For enhanced functionality and flexibility, we strongly recommend using the new v1.1 endpoint (/api/v1.1/spot/order) for all order creations

https://hashkeyglobal-apidoc.readme.io/reference/create-order-v1-1

Weight: 1

Certain parameters are mandatory depending on the order type:

TypeMandatory parameters
LIMITquantity, price
MARKETquantity
LIMIT_MAKERquantity, price

Request Parameters


PARAMETERTYPEReq'dDESCRIPTION
symbolSTRINGYName of instrument
e.g. "BTCUSDT", "ETHUSDT"
sideENUMYBUY or SELL
typeENUMYCurrently offer 3 order types:

- LIMIT - Limit order
- MARKET - Market order
- LIMIT_MAKER - Maker Limit order
quantityDECIMALYOrder quantity in units of the instrument

- Limit order: Represents the amount of the base asset you want to buy or sell.
For example: BTC/USDT pair, if quantity is 0.5, you're ordering 0.5 BTC

- Market order: Represents the cash amount for market buy orders and the quantity for market sell orders
For example: For BTC/USDT pair, if amount = 1000, you are placing a MARKET buy order to purchase BTC using 1000 USDT at the current market price
priceDECIMALCRequired for LIMIT and LIMIT_MAKER order
newClientOrderIdSTRINGAn ID defined by the client for the order, it will be automatically generated if it is not sent in the request.
timeInForceENUMGTC for Limit order, Limit maker order and IOC for Market order
recvWindowLONGRecv Window. Default 5000
timestampLONGYTimestamp

Response Content


PARAMETERTYPEExample valuesDESCRIPTION
accountIdLONG1467298646903017216Account number
symbolSTRINGBTCUSDTTrading pair
symbolNameSTRINGBTCUSDTTrading pair name
clientOrderIdSTRING1690084460710352An ID defined by the client for the order, it will be automatically generated if it is not sent in the request
orderIdLONG1470929500342690304System-generated order ID (up to 20 characters)
transactTimeLONG1690084460716Timestamp in milliseconds
priceDECIMAL55000Price
origQtyDECIMAL0.01Quantity
executedQtyDECIMAL0Traded Volume
statusENUMNEWOrder status (see enumeration definition for more details)
timeInForceENUMGTCDuration of the order before expiring
typeENUMLIMITOrder type (see enumeration definition for more details)
sideENUMBUYBUY or SELL
reqAmountSTRING0Requested Cash amount
concentrationSTRINGConcentration reminder message
Language
Authorization
Header
Click Try It! to start a request and see the response here!