GetBatchStatus
Description
The GetBatchStatus method retrieves the status of the requested batch.
Syntax
BatchStatus GetBatchStatus(SecurityToken securityToken, string batchId)
Arguments
Type | Name | Description | |
|---|---|---|---|
securityToken | R | A unique token that is used to identify a merchant and authenticate the API request. | |
string | batchId | R | Identifies the batch to retrieve. Note: This value is identical to |
Return Value
| Type | Description |
|---|---|
| BatchStatus | On success, the response includes all batch details. Otherwise, a BatchStatus object is returned with all amount fields set to 0 and no batch metadata. |
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header/>
<soapenv:Body>
<ebiz:GetBatchStatus>
<ebiz:securityToken>
<ebiz:SecurityId>*******-4963-4020-a53f-********</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:batchId>0</ebiz:batchId>
</ebiz:GetBatchStatus>
</soapenv:Body>
</soapenv:Envelope>private static void GetBatchStatus()
{
IeBizService apiClient = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken()
{
SecurityId = "*************-4970-ba92-************",
UserId = "",
Password = ""
};
string batchId = "0";
BatchStatus batchStatus = apiClient.GetBatchStatus(securityToken, batchId);
Console.WriteLine($"BatchRefNum: {batchStatus.BatchRefNum}");
Console.WriteLine($"Sequence: {batchStatus.Sequence}");
Console.WriteLine($"Status: {batchStatus.Status}");
Console.WriteLine($"Opened: {batchStatus.Opened}");
Console.WriteLine($"Closed: {batchStatus.Closed}");
Console.WriteLine($"Scheduled: {batchStatus.Scheduled}");
Console.WriteLine($"TransactionCount: {batchStatus.TransactionCount}");
Console.WriteLine($"SalesCount: {batchStatus.SalesCount}");
Console.WriteLine($"CreditsCount: {batchStatus.CreditsCount}");
Console.WriteLine($"VoidsCount: {batchStatus.VoidsCount}");
Console.WriteLine($"SalesAmount: {batchStatus.SalesAmount:C}");
Console.WriteLine($"CreditsAmount: {batchStatus.CreditsAmount:C}");
Console.WriteLine($"NetAmount: {batchStatus.NetAmount:C}");
Console.WriteLine($"VoidsAmount: {batchStatus.VoidsAmount:C}");
Console.WriteLine();
} // Initialize the SOAP client (replace with your actual endpoint URL)
$client = new SoapClient("https://ebizsoapapidev1.ebizcharge.net/eBizService.svc?singleWsdl");
// Define the merchant security token
$securityToken = array(
'SecurityId' => '*************-4970-ba92-************' // Replace with your actual token
);
// Define parameters for GetBatchTransactions
$batchId = "0"; // Not used in this example
// Prepare parameters for the SOAP request
$params = array(
'securityToken' => $securityToken,
'batchId' => $batchId
);
try {
// Make the SOAP request
$response = $client->GetBatchStatus($params);
// Extract result object from response
if (!isset($response->GetBatchStatusResult)) {
echo "No GetBatchStatusResult in response.\n";
exit;
}
$batchStatus = $response->GetBatchStatusResult;
echo "===== BatchStatus =====\n";
echo "BatchRefNum: " . ($batchStatus->BatchRefNum ?? '') . "\n";
echo "Sequence: " . ($batchStatus->Sequence ?? '') . "\n";
echo "Status: " . ($batchStatus->Status ?? '') . "\n";
echo "Opened: " . ($batchStatus->Opened ?? '') . "\n";
echo "Closed: " . ($batchStatus->Closed ?? '') . "\n";
echo "Scheduled: " . ($batchStatus->Scheduled ?? '') . "\n";
echo "TransactionCount: " . ($batchStatus->TransactionCount ?? '') . "\n";
echo "SalesCount: " . ($batchStatus->SalesCount ?? '') . "\n";
echo "CreditsCount: " . ($batchStatus->CreditsCount ?? '') . "\n";
echo "VoidsCount: " . ($batchStatus->VoidsCount ?? '') . "\n";
echo "SalesAmount: " . ($batchStatus->SalesAmount ?? '') . "\n";
echo "CreditsAmount: " . ($batchStatus->CreditsAmount ?? '') . "\n";
echo "NetAmount: " . ($batchStatus->NetAmount ?? '') . "\n";
echo "VoidsAmount: " . ($batchStatus->VoidsAmount ?? '') . "\n";
echo "=======================\n";
} catch (SoapFault $e) {
echo "SOAP Error: " . $e->getMessage() . "\n";
}Example Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetBatchStatusResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<GetBatchStatusResult>
<SalesAmount>60922.27</SalesAmount>
<BatchRefNum>***276</BatchRefNum>
<Closed/>
<CreditsAmount>0</CreditsAmount>
<CreditsCount>0</CreditsCount>
<NetAmount>60922.27</NetAmount>
<Opened>10/02/2025T16:23:12</Opened>
<VoidsCount>4</VoidsCount>
<SalesCount>217</SalesCount>
<Scheduled/>
<Sequence>1</Sequence>
<Status>Open</Status>
<TransactionCount>221</TransactionCount>
<VoidsAmount>109.64</VoidsAmount>
</GetBatchStatusResult>
</GetBatchStatusResponse>
</s:Body>
</s:Envelope><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetBatchStatusResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<GetBatchStatusResult>
<SalesAmount>0</SalesAmount>
<CreditsAmount>0</CreditsAmount>
<NetAmount>0</NetAmount>
<VoidsAmount>0</VoidsAmount>
</GetBatchStatusResult>
</GetBatchStatusResponse>
</s:Body>
</s:Envelope>Updated 5 months ago
