Skip to main content
POST
/
v1
/
sandbox
/
trade
/
order
Sandbox Create buy or sell order
curl --request POST \
  --url https://api.openxswitch.com/v1/sandbox/trade/order \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "walletId": "wallet-12345",
  "symbol": "BTCUSDT",
  "orderType": "limit",
  "side": "buy",
  "quantity": "0.1",
  "clientTxId": "txn-67890",
  "price": 50000,
  "requestWindow": "5000"
}
'
{
  "success": true,
  "data": {
    "id": "1234567890",
    "clientTxId": "client-tx...-123",
    "workspaceId": "656abf1e4b5f5e0012345678",
    "walletId": "656abf1e4b5f5e0098765432",
    "symbol": "BTCUSDT",
    "price": 45000.5,
    "quantity": 1.5,
    "orderType": "limit",
    "side": "buy",
    "status": "live",
    "priceAvg": 44999.75,
    "base": {
      "baseCoin": "USDT",
      "baseVolume": 67500.75
    },
    "quote": {
      "quoteCoin": "USDT",
      "quoteVolume": 67500.75
    },
    "fee": {
      "feeCoin": "USDT",
      "totalFee": 0.02
    },
    "cancelReason": "Insufficient funds",
    "createdAt": "2025-12-08T10:00:10.274Z",
    "updatedAt": "2025-12-08T10:00:10.274Z",
    "completedAt": "2025-12-08T10:00:10.274Z",
    "requestWindow": "5000"
  }
}

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
walletId
string
required

The ID of the wallet or sub-wallet associated with the order.

Example:

"wallet-12345"

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"

orderType
enum<string>
required

The type of order (market or limit).

Available options:
market,
limit
Example:

"limit"

side
enum<string>
required

The side of the order (buy or sell).

Available options:
buy,
sell
Example:

"buy"

quantity
string
required

The amount of the order.

For limit and market-sell orders, it represents the number of base coins. For market-buy orders, it represents the number of quote coins.

Example:

"0.1"

clientTxId
string

A unique client-generated trade ID for the order.

Example:

"txn-67890"

price
string

The price per unit of the amount for a limit order (required for limit orders).

Example:

50000

requestWindow
string

Time window in unix milliseconds within which the request is valid (e.g., 5000 = 5 seconds).

Example:

"5000"

Response

success
boolean
required
Example:

true

data
object
required