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

> List one customer's off-chain fills

Returns trades where the customer reference was maker or taker, newest first, each carrying its order book. This is the read behind a customer-facing trade history or a statement.

The scope is your instance and that reference across every book, so a customer trading several instruments gets one combined history.

## Path Parameters

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

## Query Parameters

<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="trades" type="array">
      Trade records, each with its `orderBook`. `makerAddress` and `takerAddress` carry `offchain:<customerRef>`. See [Get Order Book Trades](/endpoints/stock-trading/get-order-book-trades) for the field list.
    </ResponseField>

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

<Note>
  Read `makerAddress` and `takerAddress` to tell which side the customer was on, and therefore whether the fee on the row is theirs. The maker pays `makerFee`; the taker pays `takerFee`.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/stocks/api/offchain/customers/cust_1042/trades?limit=50" \
    -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}/trades?limit=50`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();

  const ref = `offchain:${customerRef}`;
  for (const t of data.trades) {
    const fee = t.makerAddress === ref ? t.makerFee : t.takerFee;
    console.log(t.price, t.quantity, fee);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "trades": [
        {
          "tradeId": "1c9e0f22-2b74-4a51-9f8e-73c1a0d4b6e5",
          "orderBookId": "clx_ob_stock_001",
          "origin": "CLOB",
          "makerAddress": "offchain:cust_2288",
          "takerAddress": "offchain:cust_1042",
          "price": "182350000",
          "quantity": "1000000",
          "makerFee": "500",
          "takerFee": "1500",
          "side": "BUY",
          "settlementStatus": "CONFIRMED",
          "createdAt": "2025-06-15T12:02: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 |
