Submit an Order
Create an order. Order methods are limit and market; each pair allows only the methods listed in its
orderMethods field in Get Exchange Info:
orderMethods value | orderMethod |
|---|---|
MARKET | market |
LIMIT | limit |
A method the pair does not allow returns ORDER_METHOD_NOT_SUPPORTED (1134). Stop orders (stoplimit,
stopmarket) are not supported through the API and always return ORDER_METHOD_NOT_SUPPORTED (1134).
Orders can only be placed if your account has sufficient funds. Once an order is placed, your account funds will be put on hold for the duration of the order.
For all transactions related to the private endpoint, you must authorize before sending your request.
For more information you can check our Authentication V1 article. This endpoint requires the Trade API key permission.
quantity,price,newOrderClientId,orderMethod,orderType,pairSymbolfields make up the request body.priceis ignored for market orders.pairSymbolaccepts eitherBTCUSDTorBTC_USDTstyle formatting; the underscore is stripped server-side.newOrderClientIdis optional (max length 50). If omitted, a GUID is generated for you. When you send it, it must be unique for your account for 24 hours.- An order identical to one of your open orders (same pair, side, price and quantity) is rejected with FAILED_ORDER_WITH_OPEN_ORDERS (1122).
- The pair's
filters[].minPriceandmaxPriceapply to thepriceof limit orders: a buy price abovemaxPricereturns PRICE_MUST_BE_LESS_THAN_MAXPRICE (1226), and a sell price belowminPricereturns PRICE_MUST_BE_GREATER_THAN_MINPRICE (1227).
Decimal fields (quantity, price) must be sent as strings using a dot (.) as the decimal separator, matching the pattern ^\d{0,12}(\.\d{1,16})?$ — for example 0.1876.
Submit Order
POST /api/v1/order
Request Body
| Name | Type | Description |
|---|---|---|
| quantity* | string | Order size. Market buy: amount of the quote asset to spend, with at most denominatorScale decimals (e.g. 12 on BTCUSDT spends 12 USDT). All other orders: amount of the base asset, with at most numeratorScale decimals. |
| price | string | Decimal string. Required for limit orders; ignored for market orders. |
| newOrderClientId | string | Your own id for the order, up to 50 characters. Must be unique per account for 24 hours; a repeat is rejected with DUPLICATE_CLIENT_ORDER_ID (1246). A GUID is generated if omitted. |
| orderMethod* | string | One of limit, market. |
| orderType* | string | One of buy, sell. |
| pairSymbol* | string | Max length 20, e.g. BTCUSDT, ETHUSDT. |
Headers
| Name | Type | Description |
|---|---|---|
| X-PCK* | string | API public key. |
| X-Stamp* | integer | Current time in milliseconds since the Unix epoch (UTC). |
| X-Signature* | string | HMAC-SHA256 signature. See Authentication V1. |
| X-Nonce | integer | Optional. Backward tolerance for X-Stamp in milliseconds. Default 5000, maximum 60000. |
- 200
- 400: validation error
{
"success": true,
"message": "SUCCESS",
"code": 0,
"data": {
"id": 9932534,
"datetime": 1543996112263,
"type": "buy",
"method": "limit",
"price": "85400.00",
"stopPrice": null,
"quantity": "0.001",
"pairSymbol": "BTCUSDT",
"pairSymbolNormalized": "BTC_USDT",
"newOrderClientId": "test"
}
}
{
"success": false,
"code": 1000,
"message": "INVALID_MODEL",
"data": {
"quantity": ["INVALID_VALUE"]
}
}
Code Example
- curl
- C#
curl -X POST "https://api.global.btcturk.com/api/v1/order" \
-H "X-PCK: YOUR_API_PUBLIC_KEY" \
-H "X-Stamp: 1735866257711" \
-H "X-Signature: COMPUTED_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"quantity": "0.001",
"price": "85400",
"newOrderClientId": "my-order-1",
"orderMethod": "limit",
"orderType": "sell",
"pairSymbol": "BTCUSDT"
}'
var payload = new
{
quantity = "0.001",
price = "85400",
newOrderClientId = "my-order-1",
orderMethod = "limit",
orderType = "sell",
pairSymbol = "BTCUSDT"
};
var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
using var client = new HttpClient { BaseAddress = new Uri("https://api.global.btcturk.com") };
client.DefaultRequestHeaders.Add("X-PCK", apiKey);
client.DefaultRequestHeaders.Add("X-Stamp", stamp);
client.DefaultRequestHeaders.Add("X-Signature", signature);
var response = await client.PostAsync("/api/v1/order", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Errors
See Error Codes for every error this endpoint can return. The most common are BALANCE_NOT_ENOUGH (1055), FAILED_MIN_TOTAL_AMOUNT (1123) and the scale errors 1126 and 1127.