Place Order

POST /api/v3/trading/order

Body Parameters

AttributeTypeLimitStop LimitStop MarketMarketDescription
pairstringrequiredrequiredrequiredrequiredThe trading pair symbol, e.g. BTC_USDT.
order_typestringrequiredrequiredrequiredrequiredMARKET, LIMIT, STOP_LIMIT, or STOP_MARKET.
order_sidestringrequiredrequiredrequiredrequiredBUY or SELL (also accepts BID / ASK).
wallet_typestringrequiredrequiredrequiredrequiredSPOT, MARGIN_CROSS, MARGIN_ISOLATED, or FUNDING.
base_amountstringrequiredrequiredrequiredoptionalBase amount as decimal string, e.g. "1.5".
quote_amountstringoptionalQuote amount as decimal string (market orders).
limit_pricestringrequiredrequiredLimit price as decimal string.
stop_pricestringrequiredrequiredStop trigger price as decimal string.
stop_operatorstringrequiredrequiredGTE or LTE.
client_order_idstringoptionaloptionaloptionaloptionalClient-specified order ID.
post_onlybooleanoptionalIf true, order will only be placed as maker.

Note: For market BUY orders, quote_amount is required. For market SELL orders, base_amount is 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"
}