---
title: "Set Stop Order"
method: POST
path: "/v1/perps/stop_order"
tags: ["Stop Orders"]
---

# Set Stop Order

`POST /v1/perps/stop_order`

Set a stop order for a particular position defined by market and direction. For how stop orders work, see [Take profit and stop loss](/take-profit-and-stop-loss).

## Request body

- SetStopOrderReq
  - `market` string, required — Perps market
  - `positionDirection` 'long' | 'short', required — Position direction this stop order watches
  - `type` 'stopLoss' | 'takeProfit', required — The type of stop order to set
  - `triggerPrice` string, required — The trigger price

## Response `200`

Updated stop orders for the market

- object
  - `success` boolean, required — Whether the request was successful
  - `error` string — Error message, present only on failure
  - `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
  - `result` ApiStopOrders
    - `market` string, required — Perps market
    - `positionDirection` 'long' | 'short' | 'neutral', required — Position direction this stop order watches
    - `stopLoss` string, nullable — Stop loss trigger price, if set
    - `takeProfit` string, nullable — Take profit trigger price, if set

## Other responses

- `400` — Bad request. The request was malformed or failed validation.
- `401` — Authentication required. Provide a valid JWT or API key.
- `403` — Access denied. The authenticated account does not have permission.
- `429` — Rate limit exceeded. Slow down request frequency.
- `500` — Internal server error.

---

[API](https://skmtc.net/ondoperps/apis/ondo-perps-rest-api.md) · [All operations](https://skmtc.net/ondoperps/apis/ondo-perps-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ondoperps/ondo-perps-rest-api/revisions/39df6b2fa672/schema)
