Skip to main content
POST
/
trading
/
orders
Place Trade
curl --request POST \
  --url http://localhost:8000/trading/orders \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "account_name": "<string>",
  "connector_name": "<string>",
  "trading_pair": "<string>",
  "trade_type": "BUY",
  "amount": 1,
  "order_type": "LIMIT",
  "price": 123,
  "position_action": "OPEN"
}
'
{
  "order_id": "<string>",
  "account_name": "<string>",
  "connector_name": "<string>",
  "trading_pair": "<string>",
  "trade_type": "<string>",
  "amount": "<string>",
  "order_type": "<string>",
  "price": "<string>",
  "status": "submitted"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request model for placing trades

account_name
string
required

Name of the account to trade with

connector_name
string
required

Name of the connector/exchange

trading_pair
string
required

Trading pair (e.g., BTC-USDT)

trade_type
enum<string>
required

Whether to buy or sell

Available options:
BUY,
SELL
amount
required

Amount to trade

Required range: x > 0
order_type
enum<string>
default:LIMIT

Type of order

Available options:
LIMIT,
MARKET,
LIMIT_MAKER
price

Price for limit orders

position_action
enum<string>
default:OPEN

Position action for perpetual contracts (OPEN/CLOSE)

Available options:
OPEN,
CLOSE

Response

Successful Response

Response model for trade execution

order_id
string
required

Client order ID assigned by the connector

account_name
string
required

Account used for the trade

connector_name
string
required

Connector used for the trade

trading_pair
string
required

Trading pair

trade_type
string
required

Trade type

amount
string
required

Trade amount

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
order_type
string
required

Order type

price
string | null
required

Order price

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
status
string
default:submitted

Order status