Get PF order data
POST /frontoffice/api/perpetual/v4/order-data
Summary
Use this method to retrieve and validate order data for Perpetual market orders before placing.
Request
Header parameters
accountId required
The trading account identifier.
Body
order object
The order data.
order.marketId string
The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: spot.btc_usdt.
Must match one of the available markets returned by the Get markets endpoint.
order.side string
The order side, indicating the direction of the trade.
Possible values:
BuySell
order.orderType string
The order type.
Possible values:
MarketLimit
order.leverage integer
The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).
order.requestedLotAmount decimal string
The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.
order.requestedPrice decimal string | nullable
The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).
Must be null or omitted for Market orders.
order.takeProfit.triggerType string · enum | nullable
The trigger calculation type for Take profit.
Possible values:
PriceRatePointsPnl
order.takeProfit.triggerSize decimal string | nullable
The trigger value in selected units.
order.stopLoss.triggerType string · enum | nullable
The trigger calculation type for Stop loss.
Possible values:
PriceRatePointsPnl
order.stopLoss.triggerSize decimal string | nullable
The trigger value in selected units.
order.stopLoss.isTrailing boolean | nullable
If true, enables Trailing behavior for Stop loss.
Request example
POST /frontoffice/api/perpetual/v4/order-data HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*
{
"order": {
"takeProfit": {
"triggerSize": "0.01",
"triggerType": "rate"
},
"stopLoss": {
"triggerSize": "-100",
"triggerType": "pnl",
"isTrailing": false
},
"marketId": "perp.btc_usdt",
"side": "Buy",
"orderType": "Limit",
"leverage": 100,
"requestedLotAmount": 0.5,
"requestedPrice": 118450
}
}
Response
In case of success, an object will be returned.
Each object contains the following information:
requiredMarginInRAT decimal string
The required margin amount, in conversion to RAT.
quoteAmount decimal string
The calculated quote asset amount for the order.
commissionAmountInRAT decimal string
The estimated commission amount to be charged, in conversion to RAT.
marginLevel decimal string | nullable
The resulting margin level.
takeProfit.price decimal string
The calculated Take profit price, based on trigger settings.
takeProfit.rate decimal string
The calculated Take profit rate.
takeProfit.points integer · int64
The calculated take profit offset, in points.
takeProfit.pnl decimal string
The projected PnL at Take profit.
stopLoss.price decimal string
The calculated Stop loss price, based on trigger settings.
stopLoss.rate decimal string
The calculated Stop loss rate.
stopLoss.points integer · int64
The calculated Stop loss offset, in points.
stopLoss.pnl decimal string
The projected PnL at Stop loss.
Response example — 200: OK
{
"order": {
"requiredMarginInRAT": "592.25",
"quoteAmount": "59225",
"commissionAmountInRAT": "0",
"marginLevel": "0.3582",
"takeProfit": {
"price": "119634.5",
"rate": "0.01",
"points": 11845,
"pnl": "592.25"
},
"stopLoss": {
"price": "118250",
"rate": "-0.0016",
"points": -2000,
"pnl": "-100"
}
}
}
