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

# Transactions

[@qonto/embed-sdk](../README) / transactions

# Variable: transactions

> `const` **transactions**: `object`

The transactions namespace contains all the client-side functions related to transaction operations.
This version uses proxy-based authentication (proxyEndpointDescriptor)
and is designed for browser environments.

For server-side operations using access tokens, import from '@qonto/embed-sdk/server/transactions'.

It can be accessed like this:

```ts theme={null}
import { transactions } from '@qonto/embed-sdk/transactions';
```

Then, the transactions object contains the functions to perform transaction operations:

```ts theme={null}
// Fetch all transactions with optional filtering
const { transactions: txns, meta } = await transactions.getTransactions({
  transactionSettings: {
    status: 'completed',
    side: 'debit',
    bankAccountId: 'account_123'
  },
  operationSettings: {
    // For client side authentication, you must provide a proxy endpoint descriptor (recommended for
    // security reasons). Read more in the Proxy endpoint descriptor implementation documentation.
    // proxyEndpointDescriptor: { path: '/v2/transactions', method: 'GET' }
  }
});

// Fetch a specific transaction by ID
const transaction = await transactions.getTransaction({
  transactionSettings: { transactionId: 'txn_123' },
  operationSettings: {
    proxyEndpointDescriptor: { path: '/v2/transactions/:transactionId', method: 'GET' }
  }
});
```

## Type declaration

### getTransaction()

> **getTransaction**: (`getTransactionParams`) => `Promise`\<[`Transaction`](../interfaces/Transaction)>

Fetches a single transaction of the current user by ID.

#### Parameters

##### getTransactionParams

[`TransactionParams`](../-internal-/interfaces/TransactionParams)\<[`GetTransactionSettings`](../-internal-/interfaces/GetTransactionSettings)>

An object containing:

* `transactionSettings`: An object with the `transactionId` property (string).
* `operationSettings`: An object with operation-level settings including
  `proxyEndpointDescriptor` (required).
  See [TransactionParams](../-internal-/interfaces/TransactionParams).

#### Returns

`Promise`\<[`Transaction`](../interfaces/Transaction)>

A promise that resolves to a transaction.

#### Remarks

This is the client-side implementation that requires `proxyEndpointDescriptor`.
For security, never expose access tokens in the browser.
Use "@qonto/embed-sdk/server/transactions" only in server-side/backend environments.

#### Throws

`InvalidParametersError` If the `transactionId` parameter is not a string or is missing.

#### Throws

`AuthenticationError` If `proxyEndpointDescriptor` is missing within `operationSettings`.

#### Throws

`EmbedApiError` If the API request fails or returns an error.

### getTransactions()

> **getTransactions**: (`getTransactionsParams?`) => `Promise`\<[`GetTransactionsResponse`](../-internal-/interfaces/GetTransactionsResponse)>

Fetches the list of transactions for the current user with optional filtering.

#### Parameters

##### getTransactionsParams?

[`TransactionParams`](../-internal-/interfaces/TransactionParams)\<[`GetTransactionsSettings`](../-internal-/interfaces/GetTransactionsSettings)>

An object containing:

* `transactionSettings`: An object with optional filtering parameters such as
  `bankAccountId`, `iban`, `status`, `side`, `operationType`, date ranges, and
  attachment filters.
* `operationSettings`: An object with operation-level settings including
  `proxyEndpointDescriptor` (required), and optional
  `paginationSettings` for managing pagination (accepts an object with `page`
  and `itemsPerPage` properties). See [TransactionParams](../-internal-/interfaces/TransactionParams).

#### Returns

`Promise`\<[`GetTransactionsResponse`](../-internal-/interfaces/GetTransactionsResponse)>

A promise that resolves to an array of transactions and a `meta`
object containing pagination state.

#### Remarks

This is the client-side implementation that requires `proxyEndpointDescriptor`.
For security, never expose access tokens in the browser.
Use "@qonto/embed-sdk/server/transactions" only in server-side/backend environments.

#### Throws

`InvalidParametersError` If any of the values provided under
operationSettings or transactionSettings is invalid.

#### Throws

`AuthenticationError` If `proxyEndpointDescriptor` is missing within `operationSettings`.

#### Throws

`EmbedApiError` If the API request fails or returns an error.
