> ## 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 an external securities book your instance owns or has imported.

`expiresAt` is the deadline from the signed order. Past it the signature can no longer settle, even though the row may still read `OPEN` until a sweeper or an incoming order retires it.

## 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">Trader's 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`.</ResponseField>
    <ResponseField name="price" type="string">Limit price in order book units.</ResponseField>
    <ResponseField name="quantity" type="string">Original quantity in order book units.</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">Reservation backing the order, or `null` once released.</ResponseField>

    <ResponseField name="cancelReason" type="string">
      Why the order closed, or `null`. Beyond `USER_CANCELLED` this can name a chain-side retirement: cancelled on chain, nonce invalidated, or filled on chain.
    </ResponseField>

    <ResponseField name="expiresAt" type="string">Deadline from the signed order, as ISO 8601.</ResponseField>
    <ResponseField name="auctionId" type="string">`null` on this venue.</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/external-securities-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>

<Note>
  The signed struct behind the order, meaning its hash, signature, nonce and salt, is not returned here. Keep the `orderHash` from [Submit Order](/endpoints/external-securities-trading/submit-order) if you need to reconcile against the chain.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/external-securities/api/orders/c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320" \
    -H "X-API-Key: trusset_your_key_here"
  ```

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

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "clx_order_812",
      "orderId": "c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320",
      "orderBookId": "clx_ob_extsec_001",
      "instanceId": "inst_abc123",
      "userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
      "accountId": "clx_acct_12",
      "side": "BUY",
      "orderType": "LIMIT",
      "price": "104200000",
      "quantity": "10000000",
      "filledQuantity": "4000000",
      "remainingQuantity": "6000000",
      "status": "PARTIALLY_FILLED",
      "timeInForce": "GTC",
      "postOnly": false,
      "selfTradePreventionMode": "NONE",
      "lockId": "clx_lock_204",
      "cancelReason": null,
      "expiresAt": "2025-06-22T12:00:00.000Z",
      "auctionId": null,
      "createdAt": "2025-06-15T12:00:00.000Z",
      "updatedAt": "2025-06-15T12:03:00.000Z",
      "orderBook": { "id": "clx_ob_extsec_001", "symbol": "HELG", "status": "ACTIVE" },
      "makerTrades": [],
      "takerTrades": [
        {
          "tradeId": "5b3c19e0-7a42-4d86-91f5-2c0e8d47b613",
          "price": "104200000",
          "quantity": "4000000",
          "makerFee": "0",
          "takerFee": "4000",
          "side": "BUY",
          "origin": "CLOB",
          "settlementStatus": "CONFIRMED",
          "createdAt": "2025-06-15T12:03:00.000Z"
        }
      ]
    }
  }
  ```
</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                    |
