Skip to main content
Retrieves all open orders for a specific user in a given market. Returns an array of all pending and partially filled orders.

Endpoint

GET /api/v1/orders

Request

Body parameters

user_id
string
required
The unique identifier of the user whose orders to retrieve
market
string
required
The trading pair market (e.g., “SOL_USDC”, “BTC_USDT”)

Response

Returns an array of order objects. Each order contains:
price
decimal
The limit price of the order
quantity
decimal
The total quantity of the order
filled_quantity
decimal
The quantity that has been filled
order_id
string
The unique identifier of the order
user_id
string
The unique identifier of the user who owns the order
side
string
The order side (“BUY” or “SELL”)
order_type
string
The type of order (“LIMIT” or “MARKET”)
order_status
string
The current status of the order (“Pending”, “Filled”, “PartiallyFilled”, or “Cancelled”)
timestamp
integer
The Unix timestamp in milliseconds when the order was created

Example

curl -X GET http://localhost:8080/api/v1/orders \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user123",
    "market": "SOL_USDC"
  }'
Success response:
[
  {
    "price": "150.50",
    "quantity": "10.0",
    "filled_quantity": "3.5",
    "order_id": "550e8400-e29b-41d4-a716-446655440000",
    "user_id": "user123",
    "side": "BUY",
    "order_type": "LIMIT",
    "order_status": "PartiallyFilled",
    "timestamp": 1727022600000
  },
  {
    "price": "152.00",
    "quantity": "5.0",
    "filled_quantity": "0.0",
    "order_id": "660e8400-e29b-41d4-a716-446655440001",
    "user_id": "user123",
    "side": "SELL",
    "order_type": "LIMIT",
    "order_status": "Pending",
    "timestamp": 1727022700000
  }
]

Error codes

  • 200 OK - Orders retrieved successfully (returns empty array if no open orders)
  • 500 Internal Server Error - Failed to retrieve orders or Redis connection error

Build docs developers (and LLMs) love