Skip to main content
POST
/
v1
/
sandbox
/
trade
/
preview
Sandbox Preview trade returns and fees
curl --request POST \
  --url https://api.openxswitch.com/v1/sandbox/trade/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "symbol": "BTCUSDT",
  "side": "buy",
  "quantity": 1.5
}
'
{
  "success": true,
  "data": {
    "symbol": "BTCUSDT",
    "side": "buy",
    "quantity": "100.50",
    "priceAvg": 25000,
    "base": {
      "baseCoin": "USDT",
      "baseVolume": 67500.75
    },
    "quote": {
      "quoteCoin": "USDT",
      "quoteVolume": 67500.75
    },
    "fee": {
      "feeCoin": "USDT",
      "totalFee": 0.02
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.openxswitch.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Body

application/json
symbol
string
required

The trading pair symbol (e.g., BTCUSDT).

Refer to the Get Trading pairs endpoint for the list of pair symbol.

Example:

"BTCUSDT"

side
string
required

The side of the trade (buy or sell).

Example:

"buy"

quantity
string
required

The amount/quantity of the trade in the base or quote coin.

Example:

1.5

Response

success
boolean
required
Example:

true

data
object
required