Skip to main content

Orders API

View and manage trading orders.

Endpoints

MethodEndpointDescription
GET/api/v1/ordersList orders
GET/api/v1/orders/:orderIdGet order details
GET/api/v1/orders/:orderId/statusGet order status
POST/api/v1/ordersPlace a new order
DELETE/api/v1/orders/:orderIdCancel an order
GET/api/v1/orders/open-tradesGet open trades

List Orders

Retrieve orders with optional filtering.

GET /api/v1/orders
Authorization: Bearer <access_token>

Query Parameters

ParameterTypeDescription
accountIdstringFilter by account ID
statusstringFilter by status (OPEN, FILLED, CANCELLED, REJECTED)
symbolstringFilter by symbol
limitnumberMax results (default: 50)
offsetnumberPagination offset

Response

{
"orders": [
{
"id": "uuid",
"accountId": "uuid",
"brokerOrderId": "ORD123456",
"symbol": "AAPL",
"side": "BUY",
"orderType": "LIMIT",
"quantity": 100,
"filledQuantity": 100,
"limitPrice": 150.00,
"avgFillPrice": 149.95,
"status": "FILLED",
"timeInForce": "DAY",
"createdAt": "2026-02-25T10:00:00Z",
"filledAt": "2026-02-25T10:00:15Z"
}
],
"total": 150,
"limit": 50,
"offset": 0
}

Get Order Details

GET /api/v1/orders/:orderId
Authorization: Bearer <access_token>

Response

{
"id": "uuid",
"accountId": "uuid",
"brokerOrderId": "ORD123456",
"symbol": "AAPL",
"side": "BUY",
"orderType": "LIMIT",
"quantity": 100,
"filledQuantity": 100,
"limitPrice": 150.00,
"stopPrice": null,
"avgFillPrice": 149.95,
"status": "FILLED",
"timeInForce": "DAY",
"duration": "DAY",
"createdAt": "2026-02-25T10:00:00Z",
"updatedAt": "2026-02-25T10:00:15Z",
"filledAt": "2026-02-25T10:00:15Z",
"account": {
"id": "uuid",
"name": "My Trading Account"
}
}

Place Order

Submit a new order for execution.

POST /api/v1/orders
Authorization: Bearer <access_token>
Content-Type: application/json

{
"accountId": "uuid",
"symbol": "AAPL",
"side": "BUY",
"orderType": "LIMIT",
"quantity": 100,
"limitPrice": 150.00,
"timeInForce": "DAY"
}

Request Body

FieldTypeRequiredDescription
accountIdstringYesTarget account ID
symbolstringYesStock symbol
sidestringYesBUY or SELL
orderTypestringYesSee Order Types
quantitynumberYesNumber of shares
limitPricenumberConditionalRequired for LIMIT orders
stopPricenumberConditionalRequired for STOP orders
timeInForcestringNoSee Time in Force

Response

{
"success": true,
"order": {
"id": "uuid",
"brokerOrderId": "ORD123457",
"status": "PENDING",
"message": "Order submitted successfully"
}
}

Cancel Order

Cancel a pending order.

DELETE /api/v1/orders/:orderId
Authorization: Bearer <access_token>

Response

{
"success": true,
"message": "Order cancellation requested",
"orderId": "uuid"
}

Order Statuses

StatusDescription
PENDINGOrder submitted, awaiting execution
OPENOrder is active in the market
PARTIALLY_FILLEDSome shares filled
FILLEDOrder completely filled
CANCELLEDOrder cancelled by user
REJECTEDOrder rejected by broker
EXPIREDOrder expired (e.g., DAY order at market close)

Order Sides

SideDescription
BUYBuy to open or cover
SELLSell to close or short
BUY_TO_COVERBuy to cover short position
SELL_SHORTSell short

Error Responses

Invalid Order

{
"error": "INVALID_ORDER",
"message": "Limit price is required for LIMIT orders"
}

Insufficient Buying Power

{
"error": "INSUFFICIENT_FUNDS",
"message": "Insufficient buying power for this order"
}

Order Not Found

{
"error": "ORDER_NOT_FOUND",
"message": "Order with ID xyz not found"
}

Trading Mode Mismatch

{
"error": "MODE_MISMATCH",
"message": "Cannot place live order while in paper mode"
}