This method retrieves the posted merchant payout batches. For payload explanations for both request and response, click here
using OneKhusa.SDK; 
using OneKhusa.SDK.Models.Transactions.BatchDisbursements; 
using OneKhusa.SDK.Models.Constants.Shared; 

//code omitted for brevity 

OneKhusaResponse<List<GetBatchesResponse>> response = await client 
    .Transactions 
    .BatchDisbursements 
    .GetBatchesAsync(new GetBatchesRequest 
    { 
        MerchantAccountNumber = 12345678, 
        BatchDate = new DateTime(2026, 1, 31), 
        IsIncremental = false, 
        PageNumber = 1, 
        NumberOfReturnedRows = 20, 
        SearchBy = SearchFields.BatchStatus, 
        SearchText = string.Empty 
    }); 

if (response is { IsSuccess: true, Data: not null }) 
{ 
    foreach (var batch in response.Data) 
    { 
        Console.WriteLine($""" 
            BatchNumber: {batch.BatchNumber}; 
            BatchStatusCode: {batch.BatchStatusCode}; 
            BatchStatusDescription: {batch.BatchStatusDescription}; 
            CapturedBy: {batch.CapturedBy}; 
            DateCaptured: {batch.DateCaptured}; 
            NumberOfTransactions: {batch.NumberOfTransactions}; 
            ProcessDate: {batch.ProcessDate}; 
            IsBatchScheduled: {batch.IsBatchScheduled} 
        """); 
    } 

    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();