Skip to main content

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 valueorderMethod
MARKETmarket
LIMITlimit

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.

warning

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, pairSymbol fields make up the request body.
  • price is ignored for market orders.
  • pairSymbol accepts either BTCUSDT or BTC_USDT style formatting; the underscore is stripped server-side.
  • newOrderClientId is 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[].minPrice and maxPrice apply to the price of limit orders: a buy price above maxPrice returns PRICE_MUST_BE_LESS_THAN_MAXPRICE (1226), and a sell price below minPrice returns PRICE_MUST_BE_GREATER_THAN_MINPRICE (1227).
danger

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​

NameTypeDescription
quantity*stringOrder 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.
pricestringDecimal string. Required for limit orders; ignored for market orders.
newOrderClientIdstringYour 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*stringOne of limit, market.
orderType*stringOne of buy, sell.
pairSymbol*stringMax length 20, e.g. BTCUSDT, ETHUSDT.

Headers​

NameTypeDescription
X-PCK*stringAPI public key.
X-Stamp*integerCurrent time in milliseconds since the Unix epoch (UTC).
X-Signature*stringHMAC-SHA256 signature. See Authentication V1.
X-NonceintegerOptional. Backward tolerance for X-Stamp in milliseconds. Default 5000, maximum 60000.
{
"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"
}
}

Code Example​

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"
}'

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.