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

> List one customer's off-chain orders

Returns orders placed under one customer reference on your instance, newest first, each carrying its order book. This is the read behind a customer-facing order blotter.

The scope is your instance and that reference only. There is no cross-instance visibility and no wallet involved.

## Path Parameters

<ParamField path="customerRef" type="string" required>
  Your reference for the customer, up to 256 characters. Matched exactly.
</ParamField>

## Query Parameters

<ParamField query="orderBookId" type="string">Restrict to one book.</ParamField>

<ParamField query="status" type="string">
  Restrict to one status: `OPEN`, `PARTIALLY_FILLED`, `FILLED`, `CANCELLED`, `EXPIRED` or `REJECTED`.
</ParamField>

<ParamField query="limit" type="integer" default="50">Page size, capped at 100.</ParamField>

<ParamField query="offset" type="integer" default="0">Rows to skip.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="orders" type="array">
      Order records, each with its `orderBook`. `userAddress` carries `offchain:<customerRef>`.
    </ResponseField>

    <ResponseField name="total" type="integer">Total matching orders.</ResponseField>
    <ResponseField name="limit" type="integer">Page size applied.</ResponseField>
    <ResponseField name="offset" type="integer">Offset applied.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/stocks/api/offchain/customers/cust_1042/orders?status=OPEN" \
    -H "X-API-Key: trusset_your_key_here"
  ```

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

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "orders": [
        {
          "orderId": "b7c1e0d4-6f2a-4f1e-9d33-5c8a1f0b2e77",
          "orderBookId": "clx_ob_stock_001",
          "userAddress": "offchain:cust_1042",
          "side": "BUY",
          "orderType": "LIMIT",
          "price": "182350000",
          "quantity": "5000000",
          "filledQuantity": "1000000",
          "remainingQuantity": "4000000",
          "status": "PARTIALLY_FILLED",
          "timeInForce": "GTC",
          "createdAt": "2025-06-15T12:00:00.000Z",
          "orderBook": { "id": "clx_ob_stock_001", "symbol": "NYF1" }
        }
      ],
      "total": 1,
      "limit": 50,
      "offset": 0
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code            | HTTP  | Cause                                                  |
| --------------- | ----- | ------------------------------------------------------ |
| `INVALID_PARAM` | `400` | `customerRef` is missing or longer than 256 characters |
