Skip to main content
POST
Add take-profit/stop-loss to a position

Authorizations

X-API-KEY
string
header
required

Your API key; see "Signing requests".

X-API-TIMESTAMP
string
header
required

Time of the request in Unix milliseconds; see "Signing requests".

X-API-SIGNATURE
string
header
required

Hex Ed25519 signature of timestamp + API key + receive window + payload; see "Signing requests". X-API-RECV-WINDOW is optional.

Body

application/json

Set at least one of takeProfit and stopLoss.

accountId
string
required

Id of the exchange account (a UUID), as listed in accountId by /api/v1/trading/account/list. Not the account's title.

Minimum string length: 1
Example:

"4b8e2f6a-91c3-4d57-a0e8-3f1c7b9d2e45"

connectorCode
string
required

Exchange connector the account trades the instrument through, such as binance_spot or binance_usdm, as listed in connectorCodes by /api/v1/trading/account/list. Required in every trading command.

Example:

"binance_usdm"

position
object
required

The position: either positionId, or instrument (with positionSide in hedge mode). Not both.

size
string
required

Part of the position the take-profit/stop-loss protects, in the position's quantity unit.

Pattern: ^(0*[1-9][0-9]*(\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*)$
Example:

"0.001"

takeProfit
object

A take-profit or stop-loss.

stopLoss
object

A take-profit or stop-loss.

Response

The request was accepted for asynchronous processing.

requestId
string
required

Id of this request, for support.

pairId
string
required

Id of the take-profit/stop-loss pair; the created orders carry it.