# Viewing Transactions

Retrieve the transaction history for a specific Client Balance account, including funding deposits and FX debits and credits.

## Viewing Transactions

The `GET /client/balance/{client_account_id}/transactions` endpoint returns a paginated history of all activity on a specific Client Balance account. This includes funding deposits, debits from FX transactions sourced from the balance, and credits from FX transactions targeting the balance.

### Transaction Types

| Type             | Direction           | Description                                                                                        |
| ---------------- | ------------------- | -------------------------------------------------------------------------------------------------- |
| `FUNDING`        | `CREDIT`            | A settled funding deposit. `related_deposit_tx_id` contains the on-chain transaction identifier.   |
| `CAPTURE_DEBIT`  | `DEBIT`             | Funds debited when this account was used as `source_type=CLIENT_BALANCE` in a Quote/Capture flow.  |
| `CAPTURE_CREDIT` | `CREDIT`            | Funds credited when this account was used as `target_type=CLIENT_BALANCE` in a Quote/Capture flow. |
| `ADJUSTMENT`     | `CREDIT` or `DEBIT` | Manual adjustment posted by Movmint operations.                                                    |

### Request

```
GET /client/balance/{client_account_id}/transactions
Authorization: Bearer <your-token>
```

#### Path Parameters

| Parameter           | Type   | Required | Description                                                                                                             |
| ------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `client_account_id` | string | Yes      | UUID of the Client Balance account. Obtained from `GET /client/balance` or from a `POST /client/balance/fund` response. |

#### Query Parameters

| Parameter | Type     | Required | Description                                                                                     |
| --------- | -------- | -------- | ----------------------------------------------------------------------------------------------- |
| `type`    | string   | No       | Filter by transaction type. One of: `FUNDING`, `CAPTURE_DEBIT`, `CAPTURE_CREDIT`, `ADJUSTMENT`. |
| `from`    | datetime | No       | Return transactions created at or after this timestamp (inclusive). ISO 8601 format.            |
| `to`      | datetime | No       | Return transactions created at or before this timestamp (inclusive). ISO 8601 format.           |
| `limit`   | integer  | No       | Maximum number of results per page. Between `1` and `200`. Defaults to `50`.                    |
| `cursor`  | string   | No       | Pagination cursor returned by a previous call. Pass this value to retrieve the next page.       |

### Code Examples

#### Go

```go
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

const baseURL = "https://sandbox.api.movmint.com/v1"

func main() {
	clientAccountID := "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

	req, err := http.NewRequest(
		http.MethodGet,
		fmt.Sprintf("%s/client/balance/%s/transactions", baseURL, clientAccountID),
		nil,
	)
	if err != nil {
		log.Fatalf("creating request: %v", err)
	}
	req.Header.Set("Authorization", "Bearer <your-token>")

	// Optionally filter by type or date range
	q := req.URL.Query()
	q.Add("type", "FUNDING")
	q.Add("limit", "20")
	req.URL.RawQuery = q.Encode()

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatalf("sending request: %v", err)
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatalf("reading response: %v", err)
	}

	if resp.StatusCode != http.StatusOK {
		log.Fatalf("unexpected status %d: %s", resp.StatusCode, body)
	}

	fmt.Println(string(body))
}
```

#### TypeScript

```typescript
const BASE_URL = "https://sandbox.api.movmint.com/v1";

async function getTransactions(
  clientAccountId: string,
  type?: string,
  cursor?: string
): Promise<void> {
  const url = new URL(
    `${BASE_URL}/client/balance/${clientAccountId}/transactions`
  );
  if (type) url.searchParams.set("type", type);
  if (cursor) url.searchParams.set("cursor", cursor);
  url.searchParams.set("limit", "20");

  const response = await fetch(url.toString(), {
    method: "GET",
    headers: {
      Authorization: "Bearer <your-token>",
    },
  });

  if (!response.ok) {
    throw new Error(`Request failed with status ${response.status}`);
  }

  const data = await response.json();
  console.log(JSON.stringify(data, null, 2));
}

getTransactions("a1b2c3d4-e5f6-7890-abcd-ef1234567890", "FUNDING");
```

#### Java

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class GetTransactionsExample {

    private static final String BASE_URL = "https://sandbox.api.movmint.com/v1";

    public static void main(String[] args) throws Exception {
        String clientAccountId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890";

        HttpClient client = HttpClient.newHttpClient();

        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(
                    BASE_URL + "/client/balance/" + clientAccountId +
                    "/transactions?type=FUNDING&limit=20"))
                .header("Authorization", "Bearer <your-token>")
                .GET()
                .build();

        HttpResponse<String> response = client.send(
                request, HttpResponse.BodyHandlers.ofString());

        if (response.statusCode() != 200) {
            System.err.printf("Unexpected status %d: %s%n",
                    response.statusCode(), response.body());
            System.exit(1);
        }

        System.out.println(response.body());
    }
}
```

#### Rust

```rust
use reqwest::header::AUTHORIZATION;

const BASE_URL: &str = "https://sandbox.api.movmint.com/v1";

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client_account_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890";

    let client = reqwest::Client::new();
    let response = client
        .get(format!(
            "{BASE_URL}/client/balance/{client_account_id}/transactions"
        ))
        .query(&[("type", "FUNDING"), ("limit", "20")])
        .header(AUTHORIZATION, "Bearer <your-token>")
        .send()
        .await?;

    if !response.status().is_success() {
        let status = response.status();
        let text = response.text().await?;
        eprintln!("Unexpected status {status}: {text}");
        std::process::exit(1);
    }

    let data: serde_json::Value = response.json().await?;
    println!("{}", serde_json::to_string_pretty(&data)?);

    Ok(())
}
```

### Example Response

A successful request returns HTTP `200` with a paginated list of transactions:

```json
{
  "data": [
    {
      "transaction_id": "txn-uuid-0001",
      "client_account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "FUNDING",
      "direction": "CREDIT",
      "asset": "USDC",
      "amount": 500,
      "balance_after": 10500,
      "related_deposit_tx_id": "0xdeadbeef1234567890abcdef1234567890abcdef1234567890abcdef12345678",
      "related_quote_id": null,
      "related_transaction_id": null,
      "created_at": "2025-06-15T11:45:00Z"
    },
    {
      "transaction_id": "txn-uuid-0002",
      "client_account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "CAPTURE_DEBIT",
      "direction": "DEBIT",
      "asset": "USDC",
      "amount": 1000,
      "balance_after": 9500,
      "related_deposit_tx_id": null,
      "related_quote_id": "123e4567-e89b-12d3-a456-426614174000",
      "related_transaction_id": "50796632-715f-477c-991e-acd73bdc6144",
      "created_at": "2025-06-15T12:01:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6InR4bi11dWlkLTAwMDIifQ=="
}
```

### Response Fields

#### ClientBalanceTransactionList

| Field         | Description                                                                                    |
| ------------- | ---------------------------------------------------------------------------------------------- |
| `data`        | Array of `ClientBalanceTransaction` objects, ordered by `created_at` descending.               |
| `next_cursor` | Opaque cursor to pass as `cursor` on the next request. `null` when there are no further pages. |

#### ClientBalanceTransaction

| Field                    | Description                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `transaction_id`         | Unique identifier for this transaction.                                                                       |
| `client_account_id`      | The Client Balance account this transaction applies to.                                                       |
| `type`                   | Transaction type: `FUNDING`, `CAPTURE_DEBIT`, `CAPTURE_CREDIT`, or `ADJUSTMENT`.                              |
| `direction`              | `CREDIT` (funds added) or `DEBIT` (funds removed).                                                            |
| `asset`                  | The asset of the transaction (e.g. `USDC`).                                                                   |
| `amount`                 | Absolute amount in `asset` units.                                                                             |
| `balance_after`          | The `available_balance` on the account immediately after this transaction posted.                             |
| `related_deposit_tx_id`  | On-chain DLT transaction ID. Populated for `FUNDING` transactions; `null` otherwise.                          |
| `related_quote_id`       | Quote identifier. Populated for `CAPTURE_DEBIT` and `CAPTURE_CREDIT` transactions; `null` otherwise.          |
| `related_transaction_id` | FX transaction identifier. Populated for `CAPTURE_DEBIT` and `CAPTURE_CREDIT` transactions; `null` otherwise. |
| `created_at`             | Timestamp when the transaction was posted.                                                                    |

### Pagination

Results are returned in pages of up to `limit` items. When there are additional pages, the response includes a `next_cursor` value. Pass this cursor as the `cursor` query parameter on your next request to retrieve the following page. When `next_cursor` is `null`, you have retrieved all matching transactions.

```
GET /client/balance/{client_account_id}/transactions?limit=20&cursor=eyJpZCI6InR4bi11dWlkLTAwMDIifQ==
```

### Error Responses

| HTTP Status | Cause                                                                                                            |
| ----------- | ---------------------------------------------------------------------------------------------------------------- |
| `404`       | No Client Balance account exists with the provided `client_account_id`, or it is not owned by your organization. |
| `500`       | An internal error occurred. Retry the request or contact Movmint support.                                        |

### Next Steps

* **[Funding Your Client Balance](./client-account-1.md)** — Deposit funds to top up your balance.
* **[Checking Your Client Balance](./client-account-2.md)** — Check available and pending balance totals.
* **[API Reference](../../../reference/Movmint%20Public%20APIs/client-balance/index.md)** — Full endpoint and schema documentation for the Client Balance APIs.