> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Order

> Retrieve one order with its book and its fills

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 a commodity book your instance owns or has imported.

## Path Parameters

<ParamField path="orderId" type="string" required>The order's `orderId`.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="id" type="string">Internal row ID.</ResponseField>
    <ResponseField name="orderId" type="string">Public order ID.</ResponseField>
    <ResponseField name="orderBookId" type="string">Book the order sits on.</ResponseField>
    <ResponseField name="instanceId" type="string">Instance that submitted the order.</ResponseField>
    <ResponseField name="userAddress" type="string">Owning wallet, lower-cased.</ResponseField>
    <ResponseField name="accountId" type="string">Trading account, or `null`.</ResponseField>
    <ResponseField name="side" type="string">`BUY` or `SELL`.</ResponseField>
    <ResponseField name="orderType" type="string">`LIMIT` or `MARKET`.</ResponseField>
    <ResponseField name="price" type="string">Limit price in order book units, or `null` for a market order.</ResponseField>
    <ResponseField name="quantity" type="string">Original quantity.</ResponseField>
    <ResponseField name="filledQuantity" type="string">Quantity filled so far.</ResponseField>
    <ResponseField name="remainingQuantity" type="string">Quantity still working.</ResponseField>
    <ResponseField name="status" type="string">`OPEN`, `PARTIALLY_FILLED`, `FILLED`, `CANCELLED`, `EXPIRED` or `REJECTED`.</ResponseField>
    <ResponseField name="timeInForce" type="string">`GTC`, `IOC` or `FOK`.</ResponseField>
    <ResponseField name="postOnly" type="boolean">Whether the order refused to take.</ResponseField>
    <ResponseField name="selfTradePreventionMode" type="string">Self-trade policy in force.</ResponseField>
    <ResponseField name="lockId" type="string">Balance lock backing the order, or `null`.</ResponseField>
    <ResponseField name="cancelReason" type="string">Why the order closed, or `null`. Values include `USER_CANCELLED` and `PRICE_BAND_VIOLATION`.</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="orderBook" type="object">The full order book record. See [Get Order Book](/endpoints/commodity-trading/get-order-book).</ResponseField>
    <ResponseField name="makerTrades" type="array">Trades where this order was the resting side.</ResponseField>
    <ResponseField name="takerTrades" type="array">Trades where this order was the aggressing side.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/commodities/api/orders/f2a9c7d1-40e6-4b83-95c0-7d18a3e6b204" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/orderbooks/commodities/api/orders/${orderId}`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "clx_order_640",
      "orderId": "f2a9c7d1-40e6-4b83-95c0-7d18a3e6b204",
      "orderBookId": "clx_ob_comm_001",
      "instanceId": "inst_abc123",
      "userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
      "accountId": null,
      "side": "BUY",
      "orderType": "LIMIT",
      "price": "2412550000",
      "quantity": "1000000",
      "filledQuantity": "0",
      "remainingQuantity": "1000000",
      "status": "OPEN",
      "timeInForce": "GTC",
      "postOnly": false,
      "selfTradePreventionMode": "NONE",
      "lockId": "clx_lock_311",
      "cancelReason": null,
      "createdAt": "2025-06-15T12:00:00.000Z",
      "updatedAt": "2025-06-15T12:00:00.000Z",
      "orderBook": { "id": "clx_ob_comm_001", "symbol": "XAUA", "status": "ACTIVE" },
      "makerTrades": [],
      "takerTrades": []
    }
  }
  ```
</ResponseExample>

## 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                    |
