Skip to main content
POST
/
v1
/
perps
/
stop_order
Set Stop Order
curl --request POST \
  --url https://api.ondoperps.xyz/v1/perps/stop_order \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "market": "AAPL-USD.P",
  "positionDirection": "long",
  "type": "stopLoss",
  "triggerPrice": "9.00"
}
'
{
  "success": true,
  "result": {
    "market": "AAPL-USD.P",
    "positionDirection": "long",
    "stopLoss": "200.00",
    "takeProfit": null
  }
}

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"

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