Sync Linnworks With Actinic (Work In Progress)

Overview

In the run up to Christmas one of my clients (Skate Asylum for those interested) is going to get a lot of orders. Every year it gets more and more and this year writing out address labels by hand is not going to cut it. What we wanted was a solution that involves less key depressions for the staff, and less pen to paper.

http://www.linnworks.com/@LINNWORKS

We found Linnworks after trying a few other solutions. The deal breaker was in fact its smooth integration with ParcelForce, something the online tutorial videos showed clearly and looked very slick. Surprisingly (and this does not happen very often) after setting up the login details with the Parcelforce API over the phone, it worked exactly as they showed. We were happy. I set about integrating their Amazon account. This also worked as advertised. I integrated 2 Interspire websites. They all imported the orders for processing.

Of the 2 Interspire sites that are integrated, only 1 is active. The other one is in development. This unfinished site has been set up to work when we activate it, but does not yet receive orders. This is because we’re waiting until after christmas. Nobody wants to activate a new site only for problems to arise in the middle of your busiest period. Patience is the key for them. It’ll pay off to wait and see how the market goes before they crack open a fresh solution.

In the meantime the reliable shop they are waiting on is Actinic. During the christmas period it’ll recieve hundreds of orders every day, and processing them will be a struggle. We need that data into Linnworks so we can process it super quick and log parcels into the courier in a snap. For this solution we aren’t tracking stock. We only want the line items and the address for delivery in there so we can print labels. We’re not counting stock, and we’re not bothered about certain values like weight and tax and all that jazz. This is good, it means we can take a shortcut or two.

So, what do we need and what do I have?

We need an XML feed. Linnworks reads XML from a webservice you install on your own server to get new orders. It looks like this:

Shop MySQL Database -> PHP/Webserver -> XML -> Linnworks

The problem is that Actinic Catalog runs from an Access database. We need to create that XML and it has to be a particular way too. The Linnworks sync manager expects specific values and it complains loudly if you dont feed it the right things.

Luckily a few years ago I created something that will help here. Actinet Intranet is essentially an install of Apache Webserver on the same computer as the Actinic Catalog that creates an Intranet so a shop owner and their staff can view order data. Its free now, so… aren’t you lucky? If you run Actinic you can give it a go for free. Its yours to install. If you want to connect Linnworks up later on then you’ll need Actinet. Go and install it now. I’ll wait for you right Here.

Back so soon? Well as you can see it run in php (look at the address bar). What Actinet is doing is connecting to the Actinic Catalog local database. Thats right… you guessed it. We are actually going to do this:

Shop Access Database -> PHP/Webserver -> XML -> Linnworks

Linnworks themselves provide you with some PHP to connect to any generic MySQL Database with the app. The easy part was re-tooling this to work with The access database that actinic uses. I spent half day reading this document about ODBC in PHP. After 6 hours of clean room design, my new XML service was ready. I put it in the the root of my Actinic Intranet, fed it the database details and voila! I get XML. I breathe easy. Celebratory cups of coffee and biscuits.

One in the bank.

The next part is writing the query SQL. In Linnworks you integrate by pointing the software to the location on the internet of your XML connector, and then provide the linnworks app with some SQL to run against the connector to pull things like the recent open orders and what products are in that order. There is also SQL to sync back up to the shop the status of an order and set it as ‘shipped’ and more SQL to set the stock levels and things like that.

So far… I’ve written the part that gets the orders and the part that gets the line items. No code yet for syncing the stock, and none for telling the shop things are shipped / completed. Thats for another article.

Catch you next time: Sync stock and mark as shipped.

Edit Wed 12th Oct 2011:

My solution was only a days blast at the problem and i’m sure that it can be much better but…

It pulls in the orders for processing in Linnworks, there are some financial details missing, like tax.
Weight is missing. this affects shipping rules in Linnworks. Product variations information like ‘size’ and ‘colour’ are missing and i fear that it may be impossible to get them in due to the way actinic builds its products. Linnworks can never ‘complete’ an order like Actinic does. What I did get working was when you ‘Process’ an order in Linnworks, I change the highlight colour in Actinic. The colour can be configured. This is so that an Actinic user can quickly ctrl + click the offending highlighted items and *actually* complete them. Stock sync? I havent even looked at it. Yesterday my primary concern was getting the addresses and order numbers into the system so that they could be printed as labels and sent to the parcelforce API correctly. Full integration is a little way off yet. Some of it may not be even possible.
I’ll keep you posted.
Edit Tur 25th Oct 2011:
I have a version of my script available to download here, complete with instructions.
RELEASE ALPHA 1
===================================
Download here:
http://www.gabrielcrowe.co.uk/upload…-connector.zip
(Install instructions included in zip) 

If you get it working and feel compelled to donate to further development then paypal me a beer:
paypal@angrydinosaur.co.uk

BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP BACK UP YOUR SHOP.

Got it? Good.

Linking Linnworks to Actinic to fetch orders.

This document explains how to get data out of Actinic Catalog and into Linnworks for processing. Due to limitations in the sync, the data is really only useful for postal processing (label automation) and invoice printing (Linnworks supports easily editable custom templates.)

It DOES:
- Sync orders and associated line items
- Sync delivery and shipping addresses separately
- Highlight orders in Actinic Catalog when you ‘complete’ them in Linnworks *
- Get the email address so you can email from Linnworks
- Sync ‘Order Notes’ or special delivery instructions.
- Sync only ‘Full Payment Received’ AND ‘Pre-authorized (PSP)’ orders
- Sync only ‘New’ orders **.

It DOES NOT:
- Complete orders in Actinic catalog
- Sync ANY stock back to Actinic Catalog
- Sync Deleted Orders
- Care what payment provider you use
- Sync payment ‘Pending’
- Work for delivery addresses outside the UK ***

NOTES:

* Linnworks cannot complete orders in the traditional sense because Actinic does a lot more than simply set a status. Linnworks sends a single SQL query to Actinic and this query isn’t nearly advanced enough. My workaround was to simply highlight the row in Actinic for manual processing using a real human being. Actinic lets you complete in batches so I don’t see this as a big hurdle.

** Because of the behaviour or syncing only pending orders, the moment you ‘complete’ an order in Actinic Catalog, it will not sync. You should sync BEFORE you fiddle with your orders in Actinic.

*** To get this working as soon as possible I assume that all countries are in the UK. this will be fixed in a later version.

———-
HOTFIX: Due to a pathetic schoolboy error on my part, the time was not correctly passed to Linnworks, meaning all orders look like they happened at midnight.

On line 170 of the connector look for this line:

Code:
$thisvalue = $thisyear.'-'.$thismonth.'-'.$thisday;

and make it say this:

Code:
$thisvalue = $thisyear.'-'.$thismonth.'-'.$thisday.' '.$thisdatearr[1];

Now the correct times will be passed on your next sync.

  • http://twitter.com/teach_primary Larissa – PCR

    Sounds brilliant, looking forward already to the stock sync and mark as shipped – now that would just be perfect :)

blog comments powered by Disqus