File Utilities
The following describes some file utility calls. These calls allow for the generation and output of various reports in the system. Both utilities accept two parameters: type and recordid. Current report type options are:
- orderDispatch - Generates an order dispatch PDF for the order specified by recordid
- orderInvoice - Generates an invoice PDF for the order specified by recordid
Report
The report utility call allows the developer to generate and return a filename for a given report. The resulting file can then be pulled seperately via HTTPS using url/reports/filename. Files generated in this way will be available for download for up to 24 hours.
Property | Example | Description |
---|---|---|
filename | "DISPATCH_161904.pdf" | Filename of the created document which can be fetched using url/reports/filename. |
Example
url/api/report?type=orderdispatch&recordid=82299F9C1207DF4FB105CC7D724A01AD
{
"filename": "DISPATCH_161904.pdf"
}
File Output
The fileOutput utility call allows the developer to return a Base64 output of a given report. The developer can then save the document by converting the Base64 response and saving to a document.
Property | Example | Description |
---|---|---|
date | "JVBERi..." | Base64 text string that can be decoded and saved as a document. |
Example
url/api/fileoutput?type=orderdispatch&recordid=82299F9C1207DF4FB105CC7D724A01AD
{
"data": "JVBERi0xLjMKJf////8KOCAwIG9iago8PAovVHlwZSAvRXh0R1N0YXRlCi9jYSAxCi9DQSAxCj4=="
}