Skip to main content

Toggle Margin Trade

Turn on / off spot margin trade

Covers: Margin trade (Classic Account)

HTTP Request

POST /v5/spot-cross-margin-trade/switch

Request Parameters

ParameterRequiredTypeComments
switchtrueinteger1: on, 0: off

Response Parameters

ParameterTypeComments
switchStatusintegerMargin trade status. 1: on, 0: off

Request Example

POST /v5/spot-cross-margin-trade/switch HTTP/1.1
Host: api-testnet.bybit.com
Content-Type: application/json
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1677747804512
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXXX
Content-Length: 19

{
"switch": 0
}

Response Example

{
"retCode": 0,
"retMsg": "success",
"result": {
"switchStatus": 0
},
"retExtInfo": {},
"time": 1677747804974
}