Skip to main content
POST
/
v1
/
perps
/
orders
Create Order
curl --request POST \
  --url https://api.ondoperps.xyz/v1/perps/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "clientOrderId": "order123",
  "market": "AAPL-USD.P",
  "price": "1.55",
  "side": "buy",
  "size": "20.30"
}
'
{
  "success": true,
  "result": {
    "orderId": "197ec08e001658690721be129e7fa595",
    "clientOrderId": "order123",
    "side": "buy",
    "price": "227.50",
    "size": "10.00",
    "market": "AAPL-USD.P",
    "filledSize": "0.00",
    "lastFillSize": "0.00",
    "filledCost": "0.00",
    "fee": "0.00",
    "status": "open",
    "createdAt": "2025-03-05T14:30:00Z",
    "type": "limit",
    "timeInForce": "GTC",
    "reduceOnly": false
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
side
enum<string>
required

buy or sell

Available options:
buy,
sell
Example:

"buy"

market
string
required

Trading market pair

Example:

"AAPL-USD.P"

price
string

Limit price. Must be aligned with quoteIncrement from /v1/markets. Omit for market orders.

Example:

"1.55"

size
string

Order quantity in base currency. Used for both limit and market orders. Must be aligned with baseIncrement from /v1/markets.

Example:

"20.30"

quoteSize
string

Order quantity in quote currency. Can only be set for market order buys.

Example:

"13.0967"

clientOrderId
string

Optional client-provided order ID. Must be alphanumeric including underscores and dashes, and at most 64 characters.

Example:

"order123"

type
enum<string>

Order type. Defaults to "limit".

Available options:
limit,
market
Example:

"limit"

timeInForce
enum<string>

"GTC" (Good until cancelled) or "IOC" (Immediate or cancel). Cannot be set for market orders. Defaults to "GTC".

Available options:
GTC,
IOC
Example:

"GTC"

postOnly
boolean

If true, the order is rejected if it would match at placement. Returns 400 with error post_only_has_match if it would match.

Example:

false

reduceOnly
boolean

If true, the order can only reduce an existing position.

Example:

false

takeProfit
object
stopLoss
object

Response

Created order

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