using OneKhusa.SDK;
using OneKhusa.SDK.Models.Analytics;
using OneKhusa.SDK.Models.Constants.Analytics;
//code omitted for brevity
OneKhusaResponse<List<GetConnectorSummaryBySumResponse>> response = await client
.Merchants
.Analytics
.GetConnectorSummaryBySumAsync(new GetConnectorSummaryBySumRequest
{
MerchantAccountNumber = 12345678,
SummaryType = SummaryTypes.Disbursements,
FromDate = new DateTime(2026, 1, 1),
ToDate = new DateTime(2026, 1, 31)
});
if (response is { IsSuccess: true, Data: not null })
{
foreach (var connector in response.Data)
{
Console.WriteLine($"""
ConnectorName: {connector.ConnectorName};
CurrencyCode: {connector.CurrencyCode};
SuccessfulTransactions: {connector.SuccessfulTransactions};
FailedTransactions: {connector.FailedTransactions};
TotalTransactions: {connector.TotalTransactions}
""");
}
Console.ReadLine();
return;
}
//it means an error has occurred: RFC7807 compliant error object
Console.WriteLine($"""
Type: {response.Error?.Type};
Title: {response.Error?.Title};
Detail: {response.Error?.Detail};
ErrorCode: {response.Error?.ErrorCode};
Status: {response.Error?.Status};
Instance: {response.Error?.Instance};
Errors: {string.Join(";", response.Error?.Errors ?? [])}
""");
Console.ReadLine();
Analytics
Get Connector Summary By Sum
This method retrieves merchant analytics on successful, reversed and failed disbursement and collection transactions per connector on summation of transaction amount. For payload explanations for both request and response, click here