Get Open Batch API Overview

An overview of the Get Open Batch API

With the Get Open Batch API, you can receive high-level information about your FBO's current open batch. As you can only have a single batch open at any given time for a merchant, the execution of this operation only requires the authentication information in the request header.

📘

Important Note

If you have not created a Sale transaction since you last closed a batch, there will be no currently open batch until you create another transaction.

After providing your credentials, you can access the Get Open Batch API through the following endpoint:

OperationEndpoint PathMethod
Get Open Batchapi/v1/batches/openGET

Here is a simple example of how to use the API:

// Import libraries
using System.Net.Http.Headers;

// Initiate HTTP client
HttpClient client = new HttpClient();

// Set API endpoint
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://cert-proc.precisionpay.com/api/v1/batches/open");

// Set headers
request.Headers.Add("accept", "*/*");
// Set merchant number
request.Headers.Add("MerchantNbr", "ENTER YOUR MERCHANT NUMBER");
// Set Username
request.Headers.Add("Username", "ENTER YOUR USERNAME");
// Set password
request.Headers.Add("Password", "ENTER YOUR PASSWORD");

// Call endpoint
HttpResponseMessage response = await client.SendAsync(request);
// Store response
string responseBody = await response.Content.ReadAsStringAsync();

// Print response
Console.WriteLine(responseBody);
# Import libraries
import requests, json

# Set authentication
MERCHANTNBR = 'ENTER YOUR MERCHANT NUMBER'
USERNAME = 'ENTER YOUR USERNAME'
PASSWORD = 'ENTER YOUR PASSWORD'

# Set endpoint
ENDPOINT = 'https://cert-proc.precisionpay.com/api/v1/batches/open'

# Set headers
HEADERS = {
    'accept': '*/*',
    'MerchantNbr': MERCHANTNBR,
    'Username': USERNAME,
    'Password': PASSWORD,
    'Content-Type': 'application/json',
}

# Call endpoint
response = requests.get(ENDPOINT, headers=HEADERS).json()

# Print response
print(json.dumps(response, indent=4))
// Set authentication
const merchantNbr = 'ENTER YOUR MERCHANT NUMBER';
const username = 'ENTER YOUR USERNAME';
const password = 'ENTER YOUR PASSWORD';

// Set endpoint
const endpoint = 'https://cert-proc.precisionpay.com/api/v1/batches/open';

// Set headers
const header = {
    'accept': '*/*',
    'MerchantNbr': merchantNbr,
    'Username': username,
    'Password': password,
    'Content-Type': 'application/json',
}

// Call endpoint
fetch(endpoint, {
    method: 'GET',
    headers: header,
})
    // Get response
    .then(response => response.text())
    // Print response
    .then(data => console.log(data));