This method submits bulk disbursement transactions using a JSON payload. For payload explanations for both request and response, click here
using OneKhusa.SDK; 
using OneKhusa.SDK.Models.Transactions.BatchDisbursements; 
using OneKhusa.SDK.Models.Constants.TestAccounts; 

//code omitted for brevity 
 
OneKhusaResponse<UploadBatchJsonResponse> response = await client 
    .Transactions 
    .BatchDisbursements 
    .UploadJsonAsync(new UploadBatchJsonRequest 
    { 
        Header = new BatchJsonHeader 
        { 
            MerchantAccountNumber = 12345678, 
            IsBatchScheduled = false, 
            CapturedBy = "joe.doe@example.com" 
        }, 

        Transactions = [ 
            new BatchJsonTransaction 
            { 
                TransactionAmount = 1500000.00M, 
                BeneficiaryName = "JOE DOE", 
                SourceReferenceNumber = "QWSFCTXF882", 
                BeneficiaryAccountNumber = BankAccounts.AccountNumber1, 
                ConnectorId = 221300, 
                TransactionDescription = "FEB26 SALARY PAYMENT" 
            }, 
            new BatchJsonTransaction 
            { 
                TransactionAmount = 1625000.00M, 
                BeneficiaryName = "MARY DOE", 
                SourceReferenceNumber = "QWSFCRCC883", 
                BeneficiaryAccountNumber = MobileWallets.PhoneNumber1, 
                ConnectorId = 112400, 
                TransactionDescription = "FEB26 SALARY PAYMENT" 
            } 
        ] 
    }); 

if (response is { IsSuccess: true, Data: not null }) 
{ 
    Console.WriteLine($""" 
        MerchantAccountNumber: {response.Data.MerchantAccountNumber};  
        BatchNumber: {response.Data.BatchNumber};
        BatchStatusCode: {response.Data. BatchStatusCode};
    """); 
    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();
Note:
  • This method accepts custom idempotency key generated by your system. By default, if not specified, it will create one on your behalf.
  • To schedule the batch, set IsBatchScheduled to true and set future date to ScheduledDate.