Overview
The Orders API allows you to execute trades, modify existing orders, cancel orders, and preview orders before execution.Package Reference
Methods
PlaceOrder()
Place a new trading order.Symbol(string): Stock symbolQuantity(int): Number of sharesSide(string): “buy” or “sell”OrderType(string): “market”, “limit”, “stop”, “stop_limit”Price(float64, optional): Limit priceStopPrice(float64, optional): Stop priceTimeInForce(string): “day”, “gtc”, “ioc”, “fok”
*Order, error
UpdateOrder()
Modify an existing order.orderID(string): Order IDupdate(*OrderUpdate): Fields to update
*Order, error
CancelOrder()
Cancel an active order.orderID(string): Order ID to cancel
error
PreviewOrder()
Preview order before placing.*OrderPreview, error
Order Types
Market Orders
Limit Orders
Stop Orders
Stop-Limit Orders
Examples
Preview Before Trading
Bracket Order Strategy
Type Definitions
Error Handling
Related APIs
- Accounts - Check balances before trading
- Market Data - Get current prices
- Users - Retrieve trading accounts