Skip to main content
POST
/
orderbooks
/
stocks
/
api
/
offchain
/
orders
{
  "orderBookId": "ob_offchain_001",
  "customerRef": "cust_12345",
  "side": "BUY",
  "orderType": "LIMIT",
  "price": "100000000000000000000",
  "quantity": "5000000000000000000",
  "timeInForce": "GTC"
}
{
  "success": true,
  "data": {
    "id": "ord_oc_001",
    "orderBookId": "ob_offchain_001",
    "customerRef": "cust_12345",
    "side": "BUY",
    "orderType": "LIMIT",
    "price": "100000000000000000000",
    "quantity": "5000000000000000000",
    "filledQuantity": "0",
    "status": "OPEN",
    "timeInForce": "GTC",
    "createdAt": "2025-01-15T10:30:00.000Z"
  },
  "metadata": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2025-01-15T10:30:00.000Z",
    "instanceId": "inst_abc"
  }
}
Submits an order to an off-chain order book. Instead of an EVM wallet address, off-chain orders use a customerRef string to identify the trading party. This maps to your internal customer management system.

Authentication

Requires an instance API key with the trading service enabled.

Request Body

orderBookId
string
required
The target order book identifier. Max 100 characters.
customerRef
string
required
Your internal customer reference identifier. 1-256 characters.
side
string
required
Order side. One of BUY or SELL.
orderType
string
required
Order type. One of LIMIT or MARKET.
price
string
Limit price in quote token base units (wei). Required for LIMIT orders. Numeric string.
quantity
string
required
Order quantity in base token units (wei). Numeric string.
timeInForce
string
Time-in-force policy. One of GTC (default), IOC, or FOK.
{
  "orderBookId": "ob_offchain_001",
  "customerRef": "cust_12345",
  "side": "BUY",
  "orderType": "LIMIT",
  "price": "100000000000000000000",
  "quantity": "5000000000000000000",
  "timeInForce": "GTC"
}
{
  "success": true,
  "data": {
    "id": "ord_oc_001",
    "orderBookId": "ob_offchain_001",
    "customerRef": "cust_12345",
    "side": "BUY",
    "orderType": "LIMIT",
    "price": "100000000000000000000",
    "quantity": "5000000000000000000",
    "filledQuantity": "0",
    "status": "OPEN",
    "timeInForce": "GTC",
    "createdAt": "2025-01-15T10:30:00.000Z"
  },
  "metadata": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2025-01-15T10:30:00.000Z",
    "instanceId": "inst_abc"
  }
}

Error Codes

CodeStatusDescription
ORDER_BOOK_NOT_FOUND404Order book does not exist
ORDER_BOOK_INACTIVE400Order book is paused or closed
WRONG_SETTLEMENT_MODE400Order book uses on-chain settlement
INSUFFICIENT_BALANCE400Customer does not have sufficient balance
ORDER_TOO_SMALL400Quantity below minimum
ORDER_TOO_LARGE400Quantity above maximum
PRICE_REQUIRED400Price is required for limit orders
INVALID_QUANTITY400Invalid quantity value
INVALID_PRICE400Price does not align with tick size