Skip to main content
POST
Set Stop Order

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
market
string
required

Perps market

Example:

"AAPL-USD.P"

positionDirection
enum<string>
required

Position direction this stop order watches

Available options:
long,
short
Example:

"long"

type
enum<string>
required

The type of stop order to set

Available options:
stopLoss,
takeProfit
Example:

"stopLoss"

triggerPrice
string
required

The trigger price

Example:

"9.00"

quantity
string

Optional. Sets a partial stop order for this quantity of the position instead of the full position. Omit to close the full position when triggered.

Example:

"0.5"

builderCode
object

Optional. Attributes the eventual triggered close to a builder for commission. Must be set explicitly on this request for the close to carry builder commission; it is not inherited from the builderCode on the order(s) that originally opened the position.

Response

Updated stop orders for the market

success
boolean
required

Whether the request was successful

Example:

true

error
string

Error message, present only on failure

Example:

""

error_code
string

Semantic error code. See each endpoint's error responses for the specific codes it can return.

deprecated
string

Deprecation notice, if applicable

Example:

""

result
object