Margin

Margin Account New Order (TRADE)

Post a new order for margin account.

Weight(UID): 6

post/sapi/v1/margin/order

Query parameters

symbolstring required
Example:BNBUSDT

Trading symbol, e.g. BNBUSDT

isIsolated'TRUE' | 'FALSE'
  • TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
side'SELL' | 'BUY' required
Example:SELL
type'LIMIT' | 'MARKET' | 'STOP_LOSS' | 'STOP_LOSS_LIMIT' | 'TAKE_PROFIT' | 'TAKE_PROFIT_LIMIT' | 'LIMIT_MAKER' required
Example:LIMIT

Order type

quantitynumber double required
Example:1
quoteOrderQtynumber double

Quote quantity

pricenumber double
Example:219

Order price

stopPricenumber double
Example:221.01

Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.

newClientOrderIdstring

Used to uniquely identify this cancel. Automatically generated by default

icebergQtynumber double

Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.

newOrderRespType'ACK' | 'RESULT' | 'FULL'

Set the response JSON.

sideEffectType'NO_SIDE_EFFECT' | 'MARGIN_BUY' | 'AUTO_REPAY'

Default NO_SIDE_EFFECT

timeInForce'GTC' | 'IOC' | 'FOK'
Example:GTC

Order time in force

autoRepayAtCancelboolean required
Example:true
selfTradePreventionMode'EXPIRE_TAKER' | 'EXPIRE_MAKER' | 'EXPIRE_BOTH' | 'NONE'
Example:EXPIRE_TAKER

The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.

recvWindowinteger
Example:5000

The value cannot be greater than 60000

timestampinteger required

UTC timestamp in ms

signaturestring required

Signature

Response

Margin order info

OR
OR

Example response

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595
}

Changes

Changed in 2 of the 26 revisions of this API.448

    • added the new required query request parameter autoRepayAtCancel

      new-required-request-parameter

    • added the new optional query request parameter selfTradePreventionMode

      new-optional-request-parameter

  • a484ce871a72347See the full diff
    • for the query request parameter recvWindow, the type/format was changed from integer/ to integer/int64

      request-parameter-type-changed

    • for the query request parameter timestamp, the type/format was changed from integer/ to integer/int64

      request-parameter-type-changed

    • the oneOf[marginOrderResponseFull]/marginBuyBorrowAmount response's property type/format changed from number/float to number/double for status 200

      response-property-type-changed

    • for the query request parameter icebergQty, the type/format was generalized from number/float to number/double

      request-parameter-type-generalized

    • for the query request parameter price, the type/format was generalized from number/float to number/double

      request-parameter-type-generalized

    • for the query request parameter quantity, the type/format was generalized from number/float to number/double

      request-parameter-type-generalized

    • for the query request parameter quoteOrderQty, the type/format was generalized from number/float to number/double

      request-parameter-type-generalized

    • for the query request parameter stopPrice, the type/format was generalized from number/float to number/double

      request-parameter-type-generalized

    • the response property code became required for the status 400

      response-property-became-required

    • the response property code became required for the status 401

      response-property-became-required

    • the response property msg became required for the status 400

      response-property-became-required

    • the response property msg became required for the status 401

      response-property-became-required

    • the response property oneOf[marginOrderResponseAck]/clientOrderId became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseAck]/isIsolated became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseAck]/orderId became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseAck]/symbol became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseAck]/transactTime became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/clientOrderId became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/cummulativeQuoteQty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/executedQty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/fills became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/fills/items/commission became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/fills/items/commissionAsset became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/fills/items/price became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/fills/items/qty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/isIsolated became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/marginBuyBorrowAmount became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/marginBuyBorrowAsset became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/orderId became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/origQty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/price became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/side became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/status became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/symbol became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/timeInForce became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/transactTime became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseFull]/type became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/clientOrderId became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/cummulativeQuoteQty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/executedQty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/isIsolated became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/orderId became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/origQty became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/price became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/side became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/status became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/symbol became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/timeInForce became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/transactTime became required for the status 200

      response-property-became-required

    • the response property oneOf[marginOrderResponseResult]/type became required for the status 200

      response-property-became-required