Skip to main content
Creates a new limit order for a specified market. The order will be matched against existing orders in the order book, and any unfilled quantity will remain as an open order.

Endpoint

POST /api/v1/order

Request

Body parameters

market
string
required
The trading pair market (e.g., “SOL_USDC”, “BTC_USDT”)
price
decimal
required
The limit price for the order
quantity
decimal
required
The quantity of the base asset to buy or sell
side
string
required
The order side. Must be either “BUY” or “SELL”
user_id
string
required
The unique identifier of the user placing the order

Response

Success response

status
string
Status message indicating the order was created
order_id
string
The unique identifier assigned to the created order

Error response

status
string
Status message indicating the order creation failed

Example

curl -X POST http://localhost:8080/api/v1/order \
  -H "Content-Type: application/json" \
  -d '{
    "market": "SOL_USDC",
    "price": "150.50",
    "quantity": "10.0",
    "side": "BUY",
    "user_id": "user123"
  }'
Success response:
{
  "status": "Created Order",
  "order_id": "550e8400-e29b-41d4-a716-446655440000"
}
Error response:
{
  "status": "Failed to Create Order"
}

Error codes

  • 200 OK - Order created successfully
  • 500 Internal Server Error - Failed to process the order or Redis connection error

Build docs developers (and LLMs) love