Batch Print Files

Introduction

Vouchers are generated in batches as a manually triggered action. As an output of a voucher batch:

The voucher serial number is the matching field used to correlate a voucher in the voucher server’s database to a voucher “in the wild”.

Example Batch File

The following is an example voucher batch print file, generated for a voucher batch of five vouchers and one voucher type:

# =============================================================================
# BATCH INFORMATION
# =============================================================================
# Batch name: 2020-01-01 $10 Voucher
#
# Count by voucher type:
#
#   "$10 Voucher": 5
#
#
# Total balance amount:
#   USD: "50"
#
# =============================================================================
# VOUCHER RECORDS BEGIN
# Serial number, HRN, voucher type
# =============================================================================
30201,3013243617422355,$10 Voucher
30202,4424599365145765,$10 Voucher
30203,9230653988761593,$10 Voucher
30204,2611485983387015,$10 Voucher
30205,9541459766489849,$10 Voucher

The print file format is customisable, however in the default template information is printed as a CSV file, with comment lines.

Comment lines are those with a hash (#) at the start of the line, and extend the full length of the line. Comments cannot be added to the end of the line.

Header Section

The header section of a print file is general information in no particular format. It is important to note that by default it includes the voucher batch String Identifier to allow easy matching between the voucher batch and print file.

Voucher Records Section

The voucher records section includes a CSV line for each voucher generated as part of the batch. Each CSV record includes the following fields:

Field Description
Serial Number The unique numeric serial number identifying the voucher. This is the only way to match a voucher to a record in the voucher server database, unless the HRN is encrypted and matched to an encrypted HRN record.
HRN The unencrypted HRN which a user/subscriber will use when attempting to redeem the voucher.
Voucher Type As a voucher batch may include multiple voucher types, this column matches a voucher in the print file (the HRN)

Output Location

The output location of the voucher print files will depend on the voucher batch configuration used when generating the print file. The default output location will be the /opt/nsquared/voucher directory on the OCS server responsible for generating voucher batches. Voucher generation is a serialised task, and only one OCS server will be responsible for this task.