@qonto/embed-sdk / transactions

Variable: transactions

const transactions: object = transactionsNamespace.transactions
The transactions namespace contains all the functions related to transaction operations. It provides functionality to fetch and filter transactions for the authenticated user. It can be accessed like this:
import { transactions } from '@qonto/embed-sdk/transactions';
Then, the transactions object contains the functions to perform transaction operations:
// 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 can provide a proxy function (recommended for
    //  security reasons). Read more in <a href="https://docs.qonto.com/api-reference/sdk-libraries/doc-pages/proxy-endpoint-implementation">Proxy request implementation</a>
    //  article.
    proxyRequestFunction: async (payload: string) => {}
    // Or, for server side authentication, you can provide an access token directly
    accessToken: 'your_token'
  }
});

// Fetch a specific transaction by ID
const transaction = await transactions.getTransaction({
  transactionSettings: { transactionId: 'txn_123' },
  operationSettings: {
    // For client side authentication, you can provide a proxy function (recommended for
    //  security reasons). Read more in <a href="https://docs.qonto.com/api-reference/sdk-libraries/doc-pages/proxy-endpoint-implementation">Proxy request implementation</a>
    //  article.
    proxyRequestFunction: async (payload: string) => {}
    // Or, for server side authentication, you can provide an access token directly
    accessToken: 'your_token'
  }
});

Type declaration

getTransaction()

getTransaction: (getTransactionParams) => Promise<Transaction>
Fetches a single transaction of the current user by ID.

Parameters

getTransactionParams
TransactionParams<GetTransactionSettings> An object containing:
  • transactionSettings: An object with the transactionId property (string).
  • operationSettings: An object with operation-level settings such as proxyRequestFunction (preferred over using the access token flow), accessToken, stagingToken, mfaPreference, and other optional parameters. See TransactionParams.

Returns

Promise<Transaction> A promise that resolves to a transaction.

Throws

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

Throws

AuthenticationError If both the proxyRequestFunction and accessToken are invalid or missing within operationSettings.

Throws

EmbedApiError If the API request fails or returns an error.

getTransactions()

getTransactions: (getTransactionsParams?) => Promise<GetTransactionsResponse>
Fetches the list of transactions for the current user with optional filtering.

Parameters

getTransactionsParams?
TransactionParams<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 such as proxyRequestFunction (preferred over using the access token flow), accessToken, stagingToken, mfaPreference, and other optional parameters. This function also allows managing pagination by passing the paginationSettings property under operationSettings, which accepts an object with the page and itemsPerPage properties. See TransactionParams.

Returns

Promise<GetTransactionsResponse> A promise that resolves to an array of transactions and a meta object containing pagination state.

Throws

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

Throws

AuthenticationError If both the proxyRequestFunction and accessToken are invalid or missing within operationSettings.

Throws

EmbedApiError If the API request fails or returns an error.