Linnworks has an integration with Sage via Tradebox. This integration is based on the order information exported from Linnworks and imported into Tradebox. The export file from Linnworks can be generated manually or exported on a regular basis, using a schedule.


To generate the file manually:


Go to Linnworks > Dashboards > Query Data > select query type as  "Tradebox Export" and select the start and end date.


You can then click Download (CSV file) button to export the information.

Detailed information about manual Tradebox Export can be found in this documentation article.



Automatically scheduled exports:


To create a scheduled export for Tradebox, you need to use a custom script in the export data routine. 


1. go to Linnworks > Settings > Export Data > Add Scheduled Export > Export type: Custom

2. paste the script there 

3. set up the export file path 

4. select the columns you wish to export 

5. set a schedule based on which the export will be running


For more information on this, please refer to the documentation on Export Data and Schedule.



Query:


SELECT CONVERT(VARCHAR(10), o.dReceievedDate, 103) AS 'Order Date', o.nOrderId

AS 'Order ID', oi.ItemNumber AS 'Item ID', 'SKU' = CASE WHEN pis.pkStockItemID IS NOT

NULL THEN pis.ItemNumber WHEN si.pkStockItemID IS NOT NULL THEN si.ItemNumber

WHEN oi.ChannelSKU IS NOT NULL THEN oi.ChannelSKU ELSE 'SKU Not Supplied' END,

'Product Name' = CASE WHEN pis.pkStockItemID IS NOT NULL THEN pis.ItemTitle WHEN

si.pkStockItemID IS NOT NULL THEN si.ItemTitle WHEN sis.cItemName IS NOT NULL

THEN sis.cItemName ELSE 'Product Name Not Supplied' END, 'Currency' = CASE

o.cCurrency WHEN '' THEN 'GBP' WHEN '$' THEN 'USD' WHEN '' THEN 'EUR' WHEN ''

THEN 'GBP' ELSE o.cCurrency END, oi.fPricePerUnit AS 'Product Price', oi.nQty AS

'Quantity', o.fPostageCost AS 'Carriage Amount', ISNULL(ROUND((oi.fPricePerUnit / 100) *

oi.LineDiscount,2), 0) as 'Discount', ISNULL(b.AccountName, '') AS 'Payment Method',

ps.PostalServiceName AS 'Shipping Method', 'Billing Name' =

REPLACE(ISNULL(oia.BillingName,o.cFullName),'"',''), 'Billing Company Name' =

REPLACE(ISNULL(oia.BillingCompany,o.Company),'"',''), 'Billing Address 1' =

REPLACE(ISNULL(oia.BillingAddress1, o.Address1),'"',''), 'Billing Address 2' =

REPLACE(ISNULL(oia.BillingAddress2, o.Address2),'"',''), 'Billing Address 3' =

REPLACE(ISNULL(oia.BillingTown, o.Town),'"',''), 'Billing Address 4' =

REPLACE(ISNULL(oia.BillingRegion, o.Region),'"',''), 'Billing Address 5' =

REPLACE(ISNULL(oia.BillingPostcode, o.cPostCode),'"',''), 'Billing Country' =

ISNULL(oia.BillingCountryName, lc.cCountry), 'Billing Country Code' = CASE

lc.cCountryCode WHEN 'UNK' THEN 'GB' ELSE

isnull(billcountry.cCountryCode,lc.cCountryCode) END, o.cEmailAddress AS 'Customer

Email', o.BuyerPhoneNumber AS 'Customer Telephone', o.cFullName AS 'Shipping Name',

REPLACE(o.Company,'"','') AS 'Shipping Company Name', REPLACE(o.Address1,'"','') AS

'Shipping Address 1', REPLACE(o.Address2,'"','') AS 'Shipping Address 2',

REPLACE(o.Town,'"','') AS 'Shipping Address 3', REPLACE(o.Region,'"','') AS 'Shipping

Address 4', REPLACE(o.cPostCode,'"','') AS 'Shipping Address 5', lc.cCountry AS 'Shipping

Country', lc.cCountryCode AS 'Shipping Country Code', 'Order Status' = CASE o.nStatus

WHEN '1' THEN 'Complete' END, o.Source + ' ' + o.SubSource AS 'Marketplace' FROM

[Order] o INNER JOIN OrderItem oi on oi.fkOrderID = o.pkOrderID inner join StockItems sis

on sis.pkStockID = oi.fkStockID left outer join StockItem si on sis.fkStockControlStockItemId =

si.pkStockItemID left outer join StockItem pis on pis.pkStockItemID =

oi.fkStockItemId_processed INNER JOIN PostalServices ps on o.fkPostalServiceId =

ps.pkPostalServiceId INNER JOIN ListCountries lc on o.fkCountryId = lc.pkCountryId left

outer join Order_AdditionalInfo oia on oia.fkOrderId = o.pkOrderID left outer join

Accounting_Bank b on b.pkBankId = o.fkBankId left outer join (SELECT

cCountry,cCountryCode=MAX(cCountryCode) FROM ListCountries WHERE

bLogicalDelete=0 GROUP BY cCountry) as billcountry on billcountry.cCountry =

oia.BillingCountryName WHERE (oi.fkCompositeParentRowId = '00000000-0000-0000-0000-000000000000' or

oi.fkCompositeParentRowId is null)and o.nStatus = 1 and (o.dReceievedDate BETWEEN

DATEADD(M,-1,GetDATE()) and GETDATE()) AND o.dProcessedOn IS NOT NULL AND

o.bProcessed = 1 ORDER BY o.dReceievedDate ,o.nOrderId