Skip to content

15. Balances Api

Vincent Kok edited this page Jun 7, 2024 · 2 revisions

Get balance

Retrieve a balance using a balance id string identifier.

using IBalanceClient client = new BalanceClient({yourApiKey});
BalanceResponse balanceResponse = await this._balanceClient.GetBalanceAsync({yourBalanceId});

Get primary balance

Retrieve the primary balance. This is the balance of your account’s primary currency, where all payments are settled to by default.

using IBalanceClient client = new BalanceClient({yourApiKey});
BalanceResponse balanceResponse = await this._balanceClient.GetPrimaryBalanceAsync();

List balances

Retrieve all the organization’s balances, including the primary balance, ordered from newest to oldest.

using IBalanceClient client = new BalanceClient({yourApiKey});
ListResponse<BalanceResponse> balanceList = await this._balanceClient.GetBalanceListAsync();

Get balance report

You can retrieve reports in two different formats. With the status-balances format, transactions are grouped by status (e.g. pending, available), then by transaction type, and then by other sub-groupings where available (e.g. payment method). With the transaction-categories format, transactions are grouped by transaction type, then by status, and then again by other sub-groupings where available.

This applies to both the "Get balance report" method as well as the "Get primary balance report" method.

using IBalanceClient client = new BalanceClient({yourApiKey});
string reportGrouping = ReportGrouping.TransactionCategories;
BalanceReportResponse balanceReport = await this._balanceClient.GetBalanceReportAsync({yourBalanceId}, grouping: reportGrouping);

Get primary balance report

With the Get primary balance report endpoint you can retrieve a summarized report for all movements on your primary balance within a given timeframe.

using IBalanceClient client = new BalanceClient({yourApiKey});
string reportGrouping = ReportGrouping.StatusBalances;
BalanceReportResponse balanceReport = await this._balanceClient.GetPrimaryBalanceReportAsync(grouping: reportGrouping);

List balance transactions

With the List balance transactions endpoint you can retrieve a list of all the movements on your balance. This includes payments, refunds, chargebacks, and settlements.

using IBalanceClient client = new BalanceClient({yourApiKey});
BalanceTransactionResponse balanceTransactions = await this._balanceClient.GetBalanceTransactionListAsync({yourBalanceId});

Each transaction in the list of transactions, has a context. The context properties depends on the "type" field of the transaction. For example, a transaction with the type "payment" has a context with a "payment-id" value. For a full list of transaction types and their context specific properties, take a look at the Mollie documentation of the "List balance transactions" endpoint.

List primary balance transactions

With the List primary balance transactions endpoint you can retrieve a list of all the movements on your primary balance. This includes payments, refunds, chargebacks, and settlements.

using IBalanceClient client = new BalanceClient({yourApiKey});
BalanceTransactionResponse balanceTransactions = await this._balanceClient.GetPrimaryBalanceTransactionListAsync();