Place Order
POST /api/v3/trading/order
Body Parameters
| Attribute | Type | Limit | Stop Limit | Stop Market | Market | Description |
|---|---|---|---|---|---|---|
| pair | string | required | required | required | required | The trading pair symbol, e.g. BTC_USDT. |
| order_type | string | required | required | required | required | MARKET, LIMIT, STOP_LIMIT, or STOP_MARKET. |
| order_side | string | required | required | required | required | BUY or SELL (also accepts BID / ASK). |
| wallet_type | string | required | required | required | required | SPOT, MARGIN_CROSS, MARGIN_ISOLATED, or FUNDING. |
| base_amount | string | required | required | required | optional | Base amount as decimal string, e.g. "1.5". |
| quote_amount | string | optional | Quote amount as decimal string (market orders). | |||
| limit_price | string | required | required | Limit price as decimal string. | ||
| stop_price | string | required | required | Stop trigger price as decimal string. | ||
| stop_operator | string | required | required | GTE or LTE. | ||
| client_order_id | string | optional | optional | optional | optional | Client-specified order ID. |
| post_only | boolean | optional | If true, order will only be placed as maker. |
Note: For market BUY orders,
quote_amountis required. For market SELL orders,base_amountis required.
Limit Order
{
"pair": "BTC_USDT",
"order_side": "BUY",
"wallet_type": "SPOT",
"base_amount": "1.0",
"limit_price": "45000.00",
"order_type": "LIMIT"
}
from alpcom_api import dto
req_limit = dto.LimitOrderRequest(
pair='ETH_USDT',
order_side=dto.OrderSide.SELL,
base_amount=0.05,
limit_price=1800,
)
private_api.trading().place_order(req_limit)
Market Order
{
"pair": "BTC_USDT",
"order_side": "BUY",
"wallet_type": "SPOT",
"quote_amount": "100.00",
"order_type": "MARKET"
}
from alpcom_api import dto
req_market = dto.MarketOrderRequest(
pair='ETH_USDT',
order_side=dto.OrderSide.SELL,
base_amount=0.1 # base_amount or quote_amount
)
private_api.trading().place_order(req_market)
Stop Limit Order
{
"pair": "BTC_USDT",
"order_side": "BUY",
"wallet_type": "SPOT",
"base_amount": "1.0",
"limit_price": "45000.00",
"stop_price": "44000.00",
"stop_operator": "GTE",
"order_type": "STOP_LIMIT"
}
from alpcom_api import dto
req_stop_limit = dto.StopLimitOrderRequest(
pair='ETH_USDT',
order_side=dto.OrderSide.SELL,
stop_price=1800,
stop_operator=dto.StopOperator.GTE,
base_amount=0.05,
limit_price=1700,
)
private_api.trading().place_order(req_stop_limit)
Response (array of created order IDs)
[34]
Error Response
{
"code": "1003",
"message": "invalid order amount"
}