This method downloads batch transaction data in either Excel (XLSX) or CSV format. The downloaded file contains comprehensive transaction details including processing status, fees, and response information. For payload explanations for both request and response, click here
using OneKhusa.SDK; 
using OneKhusa.SDK.Models.Reports.Files; 

//code omitted for brevity 

OneKhusaResponse<DownloadBatchDisbursementFileResponse> response = await client 
    .Reports 
    .Files 
    .DownloadBatchDisbursementFileAsync(new DownloadBatchDisbursementFileRequest 
    { 
        MerchantAccountNumber = 12345678, 
        BatchNumber = 123456, 
        DownloadType = ContentTypes.MicrosoftExcel 
    }); 

if (response is { IsSuccess: true, Data: not null }) 
{ 
    Console.WriteLine($""" 
        FileContentBase64: {response.Data.FileContentBase64} 
    """); 
    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();