post https://{BASE_URL_PROD}/v4/order/private/create
Create a new order. Returns an id of your newly created order.
This is a private
route, so you need to authorize using one of the two preferred methods.
We recommend using a single api-key
parameter for the start.
Data dictionary
Name | Type | Parameter type | Required | Range | Description |
---|---|---|---|---|---|
type | enum | BODY | YES | Limit, Market, StopLossLimit, TakeProfitLimit | Type of an order |
orderSide | enum | BODY | YES | Bid, Ask | Bid for buying base asset, Ask for selling base asset. FYI: For BTC_USDT trading pair, BTC is the base asset |
pair | string | BODY | YES | - | A trading pair as per the list from /v4/markets/public/getAll |
quantity | string | BODY | YES | - | Quantity of the base asset to buy/sell. Precision depends on the asset as per /v4/markets/public/getAll |
price | string | BODY | YES | - | Target exchange price to buy/sell the base asset. |
amount | string | BODY | YES | - | Amount of the quote asset to use. Precision depends on the asset as per /v4/markets/public/getAll |
quoteQuantity | string | BODY | YES* | - | The max quantity of the quote asset to use for selling/buying. Precision depends on the asset as per /v4/markets/public/getAll |
stopPrice | string | BODY | YES* | - | For Stop Loss orders, price threshold for stopping order execution |
For all price-, amount- and quantity-related parameters the precision depends on the asset as per /v4/markets/public/getAll
Exemplary request
To create an order, you need to include a JSON in the BODY of request. For example:
{
"type": "Limit",
"orderSide": "Ask",
"pair": "DAY_NIGHT",
"quantity": "2",
"price": "4",
"amount": "8"
}
Response structure
You will receive a JSON in the response with data
object, structured like this example:
HTTP/1.1 201 OK
Content-Type: application/json; charset=utf-8
{
"id": "3e5591ba-2778-4d85-8851-54284045ea44", // Unique identifier of a new order
}
Errors
Status | Error code | Message | Parameter | Description |
---|---|---|---|---|
400 | REQUIRED:QUANTITY | Required quantity is missing | quantity | Required parameter is missing |
400 | INVALID:MARKET | Invalid market pair | pair | Check the trading pair using /v4/markets/public/getAll |
500 | WrongRequestException | amount must be a number string | amount | Required parameter is missing |