Sage Export

Back

Overview

The Sage export returns one row per document line, in the column layout Sage 50 imports. This page describes the current shape and what changed, so the frontend report can be updated.

GET api/v1/Reports/sageexport?startDate=2026-11-01&endDate=2026-11-30
Query parameter Meaning
startDate, endDate Inclusive UK calendar days. Orders and purchase orders are filtered on their order date; invoices on their invoiced date.
documentTypeId Optional. Limits to one document type (still only the types listed below).
downloadCSV true returns a CSV file (headers are the Sage column names below); otherwise JSON.

Requires the reports:read permission.


Which documents are included (changed)

Rule Before Now
Document types All types Sales orders, invoices and purchase orders only. Quotes and other types are not exported.
Cancelled documents Included Excluded
Draft invoices Included Excluded until the invoice is issued (it has no invoiced date until then)
Invoice date range Order date Invoiced date
Dates UTC UK time (dates near midnight can move by a day)
Missing VAT code Included The whole document is excluded if any of its lines' products has no active tax code

Expect fewer rows than before for the same date range. A document missing from the export most likely has a line whose product has no active tax code.


Row shape

All values are strings. Dates are dd/MM/yyyy; money is excluding VAT with 2 decimals; text is cut to Sage's maximum length. JSON keys are camelCase (customerID, jobReference, …); CSV headers are the Sage names in the first column.

Sage column (CSV) JSON key Status Value
CustomerID customerID Unchanged Customer account code
CompanyName companyName Changed Customer name, max 60
ContactName contactName Changed Account manager name, max 30
Address1 address1 Changed Billing address, max 60
Address2 address2 Changed Billing address, max 60
Town town Changed Billing town, max 60
County county Changed Billing county, max 60
PostCode postCode Changed Billing postcode, max 60
CountryCode countryCode Unchanged Billing country code
Telephone telephone Changed Billing phone, max 30
Fax fax Unchanged Empty
OrderID orderID Changed Document id (was the document number)
JobReference jobReference New Document number (what OrderID used to hold)
DelContactName delContactName Changed Delivery contact, max 60
DelAddress1 delAddress1 Changed Delivery address, max 60
DelAddress2 delAddress2 Changed Delivery address, max 60
DelTown delTown Changed Delivery town, max 60
DelCounty delCounty Changed Delivery county, max 60
DelPostCode delPostCode Changed Delivery postcode, max 60
DelCountry delCountry Changed Delivery country, max 60
OrderDate orderDate Changed Order date, now in UK time
InvoiceDate invoiceDate New Invoiced date (UK time) for invoices; empty otherwise
Carriage carriage Changed Shipping charged ex VAT (after any shipping discount); was always 0
ProductCode productCode Changed Supplier (original) SKU; was our SKU
Description description Changed Line title first, then description; max 60
Quantity quantity Unchanged Line quantity
Price price Changed Effective unit price ex VAT (base + customisation); was the base price. Line discounts are not included.

Columns appear in the CSV in the order above. These are the only columns in the CSV and the JSON.


Frontend checklist