CSV Sales Export Overview

This document will contain information specific to the comma seperated value (CSV) sales export template. For general information about the Data Extraction Service and it's API please see the general purpose documentation

Job Run Parameters

This template supports filtering against the DBGen range OR the TradingDate of finalised SalesTransactions/ZReports.

EITHER DBGen filtering OR trading date filtering must be used. Filtering on both is not supported.

Parameter Definitions

Parameter Type Description
DBGenFrom Number (optional) The (inclusive) start of the DBGen range which will be used to filter data. (required if using DBGen filtering)
DBGenTo Number (optional) The (inclusive) end of the DBGen range which will be used to filter data. If unspecified the current latest DBGen from the server will be used.
TradingDateFrom DateTime (optional) The (inclusive) start of the TradingDate range which will be used to filter data. Please note that the time will reference the time the order/zreport was closed/finalised (required if TradingDateTo is set)
TradingDateTo DateTime (optional) The (inclusive) end of the TradingDate range which will be used to filter data. Please note that the time will reference the time the order/zreport was closed/finalised (required if TradingDateFrom is set)

Auto Value Considerations

DBGenFrom supports auto values which (when executing an auto value job run) will update to the value supplied at DBGenTo (or the latest DBGen from the sales data). When DBGenFrom is set to use an auto value it will use the value of the auto value + 1 to ensure that repeated executions will never export already exported sales data.

Output Files

Please note that the output files can be enabled/disabled based on the job config.

File Format Description
transactions.csv CSV All matching SalesTransaction entities encoded as CSV. Each JSON property will map to a column with the same name
payments.csv CSV All matching SalesTransactionPayment entities encoded as CSV. Each JSON property will map to a column with the same name
items.csv CSV All matching SalesTransactionItem entities encoded as CSV. Each JSON property will map to a column with the same name
corrections.csv CSV All matching SalesTransactionItemCorrection entities encoded as CSV. Each JSON property will map to a column with the same name
zreports.csv CSV All matching ZReport entities encoded as CSV. Each JSON property will map to a column with the same name

Overview

This export is designed for generating a regular stream of CSV encoded sales data. Only parent SalesTransaction that are closed will be included. The data can optionally be restricted to finalised Z Periods to minimise the chances of a sales transaction being rexported due to changes.

Dropbox Integration

It's possible to connect a job to a Dropbox account which allow all output files to be uploaded there in addition to the DES storage.

The files will be uploaded to the PowerEPOS App folder at Dropbox using a configurable file path pattern. The file path pattern can use %VARIABLE% definitions that will allow the uploaded files to be directed into an appropriate directory structure. For example:

/My Export Job/%DATE%/dbgen-%DBGEN%/%FILE%

Would generate a file directory structure based on date/dbgen and could generate file paths like the following:

/My Export Job/2022-11-18/dbgen-1234/transactions.csv
/My Export Job/2022-11-18/dbgen-1234/payments.csv
/My Export Job/2022-11-18/dbgen-1234/zreports.csv

The full list of available file path pattern variables:

Variable Definition Example
%FILE% The specific CSV file being uploaded transactions.csv or zreports.csv etc
%DBGEN% The value of DBGenTo that was used for this run (defaults to 0 if trading date filtering is used) 123456
%JOBID% the unique ID of the parent job a14f7392-e344-4489-9642-179b804fab5f
%RUNID% the unique ID of the individual job run (this will change every time the job runs) 217de63b-f5e5-4a4b-ad4d-009fbdf6cd91
%DATE% the UTC date of the job run in the YYYY-MM-DD format 2022-05-03
%TIME% the UTC time of the job run in 24 hour time 22:45