Orders
Get Order
Retrieve one order with its book and its fills
GET
/
orderbooks
/
stocks
/
api
/
orders
/
{orderId}
curl "https://api.trusset.org/orderbooks/stocks/api/orders/b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/orders/${orderId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const fills = [...data.makerTrades, ...data.takerTrades];
console.log(data.status, `${fills.length} fills`);
{
"success": true,
"data": {
"id": "clx_order_311",
"orderId": "b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77",
"orderBookId": "clx_ob_stock_002",
"instanceId": "inst_abc123",
"userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"accountId": "clx_acct_12",
"side": "BUY",
"orderType": "LIMIT",
"price": "182350000",
"quantity": "5000000",
"filledQuantity": "1000000",
"remainingQuantity": "4000000",
"status": "PARTIALLY_FILLED",
"timeInForce": "GTC",
"postOnly": false,
"selfTradePreventionMode": "NONE",
"auctionId": null,
"lockId": "clx_lock_88",
"cancelReason": null,
"expiresAt": null,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:02:00.000Z",
"orderBook": { "id": "clx_ob_stock_002", "symbol": "NYF1", "status": "ACTIVE" },
"makerTrades": [],
"takerTrades": [
{
"tradeId": "1c9e0f22-2b74-4a51-9f8e-73c1a0d4b6e5",
"price": "182350000",
"quantity": "1000000",
"makerFee": "500",
"takerFee": "1500",
"side": "BUY",
"origin": "CLOB",
"settlementStatus": "CONFIRMED",
"createdAt": "2025-06-15T12:02:00.000Z"
}
]
}
}
Returns a single order, the book it sits on, and every trade it took part in on either side. Resolves only if the order’s book is one your instance owns or has imported, and only for stock books.
Path Parameters
string
required
The order’s
orderId.Response Fields
object
Show child attributes
Show child attributes
string
Internal row ID.
string
Public order ID.
string
Book the order sits on.
string
Instance that submitted the order.
string
Owning wallet, lower-cased. Off-chain orders carry
offchain:<customerRef> here.string
Trading account, or
null.string
BUY or SELL.string
LIMIT or MARKET.string
Limit price in order book units, or
null for a market order.string
Original quantity.
string
Quantity filled so far.
string
Quantity still working.
string
OPEN, PARTIALLY_FILLED, FILLED, CANCELLED, EXPIRED, REJECTED or AUCTION_PENDING.string
GTC, IOC or FOK.boolean
Whether the order refused to take.
string
Self-trade policy in force.
string
Auction the order was batched into, or
null.string
Balance lock backing the order, or
null.string
Why the order closed, or
null. Values include USER_CANCELLED, PRICE_BAND_VIOLATION and self-trade prevention reasons.string
Signed-order deadline on external securities books.
null here.string
ISO 8601 timestamp.
string
ISO 8601 timestamp.
object
The full order book record. See Get Order Book.
array
Trades where this order was the resting side.
array
Trades where this order was the aggressing side.
curl "https://api.trusset.org/orderbooks/stocks/api/orders/b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/orders/${orderId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const fills = [...data.makerTrades, ...data.takerTrades];
console.log(data.status, `${fills.length} fills`);
{
"success": true,
"data": {
"id": "clx_order_311",
"orderId": "b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77",
"orderBookId": "clx_ob_stock_002",
"instanceId": "inst_abc123",
"userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"accountId": "clx_acct_12",
"side": "BUY",
"orderType": "LIMIT",
"price": "182350000",
"quantity": "5000000",
"filledQuantity": "1000000",
"remainingQuantity": "4000000",
"status": "PARTIALLY_FILLED",
"timeInForce": "GTC",
"postOnly": false,
"selfTradePreventionMode": "NONE",
"auctionId": null,
"lockId": "clx_lock_88",
"cancelReason": null,
"expiresAt": null,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:02:00.000Z",
"orderBook": { "id": "clx_ob_stock_002", "symbol": "NYF1", "status": "ACTIVE" },
"makerTrades": [],
"takerTrades": [
{
"tradeId": "1c9e0f22-2b74-4a51-9f8e-73c1a0d4b6e5",
"price": "182350000",
"quantity": "1000000",
"makerFee": "500",
"takerFee": "1500",
"side": "BUY",
"origin": "CLOB",
"settlementStatus": "CONFIRMED",
"createdAt": "2025-06-15T12:02:00.000Z"
}
]
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
ORDER_NOT_FOUND | 404 | No order with that ID, or its book is not reachable from your instance |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl "https://api.trusset.org/orderbooks/stocks/api/orders/b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/orders/${orderId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const fills = [...data.makerTrades, ...data.takerTrades];
console.log(data.status, `${fills.length} fills`);
{
"success": true,
"data": {
"id": "clx_order_311",
"orderId": "b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77",
"orderBookId": "clx_ob_stock_002",
"instanceId": "inst_abc123",
"userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"accountId": "clx_acct_12",
"side": "BUY",
"orderType": "LIMIT",
"price": "182350000",
"quantity": "5000000",
"filledQuantity": "1000000",
"remainingQuantity": "4000000",
"status": "PARTIALLY_FILLED",
"timeInForce": "GTC",
"postOnly": false,
"selfTradePreventionMode": "NONE",
"auctionId": null,
"lockId": "clx_lock_88",
"cancelReason": null,
"expiresAt": null,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:02:00.000Z",
"orderBook": { "id": "clx_ob_stock_002", "symbol": "NYF1", "status": "ACTIVE" },
"makerTrades": [],
"takerTrades": [
{
"tradeId": "1c9e0f22-2b74-4a51-9f8e-73c1a0d4b6e5",
"price": "182350000",
"quantity": "1000000",
"makerFee": "500",
"takerFee": "1500",
"side": "BUY",
"origin": "CLOB",
"settlementStatus": "CONFIRMED",
"createdAt": "2025-06-15T12:02:00.000Z"
}
]
}
}
