Margin Account New Order (TRADE)
API Description
Post a new order for margin account.
HTTP Request
POST /sapi/v1/margin/order
Request Weight
6(UID)
Request Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
isIsolated | STRING | NO | for isolated margin or not, "TRUE", "FALSE",default "FALSE" |
side | ENUM | YES | BUY SELL |
type | ENUM | YES | |
quantity | DECIMAL | NO | |
quoteOrderQty | DECIMAL | NO | |
price | DECIMAL | NO | |
stopPrice | DECIMAL | NO | Used with STOP_LOSS , STOP_LOSS_LIMIT , TAKE_PROFIT , and TAKE_PROFIT_LIMIT orders. |
newClientOrderId | STRING | NO | A unique id among open orders. Automatically generated if not sent. |
icebergQty | DECIMAL | NO | Used with LIMIT , STOP_LOSS_LIMIT , and TAKE_PROFIT_LIMIT to create an iceberg order. |
newOrderRespType | ENUM | NO | Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK. |
sideEffectType | ENUM | NO | NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; default NO_SIDE_EFFECT. More info in FAQ |
timeInForce | ENUM | NO | GTC,IOC,FOK |
selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE |
autoRepayAtCancel | BOOLEAN | NO | Only when MARGIN_BUY or AUTO_BORROW_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
- autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
Response Example
Response ACK:
{
"symbol": "BTCUSDT",
"orderId": 28,
"clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
"isIsolated": true, // if isolated margin
"transactTime": 1507725176595
}
Response RESULT:
{
"symbol": "BTCUSDT",
"orderId": 26769564559,
"clientOrderId": "E156O3KP4gOif65bjuUK5V",
"transactTime": 1713873075893,
"price": "0",
"origQty": "0.001",
"executedQty": "0.001",
"cummulativeQuoteQty": "65982.53",
"status": "FILLED",
"timeInForce": "GTC",
"type": "MARKET",
"side": "SELL",
"isIsolated": false, // if isolated margin
"selfTradePreventionMode": "EXPIRE_MAKER"
}
Response FULL:
{
"symbol": "BTCUSDT",
"orderId": 26769564559,
"clientOrderId": "E156O3KP4gOif65bjuUK5V",
"transactTime": 1713873075893,
"price": "0",
"origQty": "0.001",
"executedQty": "0.001",
"cummulativeQuoteQty": "65.98253",
"status": "FILLED",
"timeInForce": "GTC",
"type": "MARKET",
"side": "SELL",
"marginBuyBorrowAmount": 5, // will not return if no margin trade happens
"marginBuyBorrowAsset": "BTC", // will not return if no margin trade happens
"isIsolated": true, // if isolated margin
"selfTradePreventionMode": "NONE",
"fills": [
{
"price": "65982.53",
"qty": "0.001",
"commission": "0.06598253",
"commissionAsset": "USDT",
"tradeId": 3570680726
}
],
"isIsolated": false,
"selfTradePreventionMode": "EXPIRE_MAKER"
}