Skip to main content

Setup Guide

Auto Close Scheduling

This feature uses windows Task Scheduler. You will create a ps file that will run according to your schedule. We have included the content to copy, you will need to adjust your domain, username and password. This should run on the sever

Auto Close

Required Setup

In order to have the POS Auto Batch. You will need to make a Terminal under Settings - Terminals. The terminal name will be 'Batch'. Assign the values you have for one of your credit cards. This will then be used during the auto close procedure during the auto batch portion.

Guide for Setup

1. Create the PowerShell Script

In your PowerShell script, use the Invoke-RestMethod cmdlet with basic authentication to call the API.

Here’s an example PowerShell script:

# Set API URL
$apiUrl = "https://[domain]/api/TransferData/AutoClose"

# Basic Authentication
$username = "user"
$password = "pass"
$auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${username}:${password}"))

# Headers
$headers = @{
Authorization = "Basic $auth"
}

# Log file path
$logFile = "C:\pointless\AutoCloselogfile.txt"

# Ensure log directory exists
$logDir = Split-Path $logFile
if (-not (Test-Path $logDir)) {
New-Item -Path $logDir -ItemType Directory -Force | Out-Null
}

# Make API request and handle errors
try {
$response = Invoke-RestMethod -Uri $apiUrl -Method Get -Headers $headers
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
"$timestamp - Success:`n$response" | Out-File -FilePath $logFile -Append
} catch {
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
"$timestamp - Error: $_" | Out-File -FilePath $logFile -Append
}


Replace the apiUrl, username, and password with your actual API details and credentials.

2. Save & Test the Script

Save this script as a .ps1 file, for example: CallApi.ps1. Your server will normally have a directory such as c:\pointless where you would save things.

You may need to register execution policy : Set-ExecutionPolicy RemoteSigned

Test the Script

To test before you use TaskScheduler, you can run the file in powershell. Click Start, type powershell , right click - run as adminstrator. Then naviagate to the file, and type .\nameofyourfile.ps1

If you are unable to run the task, you might need to good

Test command line powershell

-ExecutionPolicy Bypass -File .\AutoClosePointlessPOS.ps1