-
-
Notifications
You must be signed in to change notification settings - Fork 85
15. Balances Api
Retrieve a balance using a balance id string identifier.
using IBalanceClient client = new BalanceClient({yourApiKey});
BalanceResponse balanceResponse = await this._balanceClient.GetBalanceAsync({yourBalanceId});
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();
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();
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);
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);
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.
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();