API Synchronisation With Other Services

Learn more about how we sync with Lightspeed, Unleashed, Xero, etc

The art of an efficient sync that is easy to debug is very very hard. 

Many of our customers have thousands of products and thousands of customers. The way some API's work, means that for each product, we have to do individual stock count lookups as well. This could produce several thousand API calls per day. At the same time, those API's place limits on how many API calls you can do a day. It is not feasable to sync every item every day. Also, if you wanted to press a button to do this, it would take so long, that you would not be able to see the result in a timely manor. 

Syncing Products and Stock

We download "recently changed products" and "recently changed inventory positions" from each API, several times a day. If you have changed a stock level or product price in your third party system, then you should see that change in our system within 2 hours. If you are in a hurry, you can manually sync individual products. This sync produces 2 API calls, but downloads between 50 and 200 items, and does a sync against our database. 

Also several times each day, we sync the oldest 10 products we can find, probably the products that you don't sell that often, and we sync those. This sync produces 20 API calls, one for product description, and one for stock description. Each day this is likely to sync 50 products. And over 20 days, it would sync 1000 products. The assumption is that this sync is only to catch ghost products, and any high moving items would have been caught by the other sync (assuming the API works as one would intend it to)

We also attempt to sync products when sold. If the product does not apepar to exist in the third party API, then we will attempt to create a new item in the API, to be sure that the order/invoice can be posted without error. 

Customer Syncing

It's very risky to override customer data, so we don't. Our customer syncs attempt to sync customers by email or account ID. This works by downloading recently updated items in your API customer list, and finding matching items in our list. We also attempt to sync customer records at sale time, if not previously linked. API's require a valid customer to exist so that a sale can complete. 

Once linked, no customer data is overriden. However, on some API's like Xero, when we post the customer data with an invoice, Xero may decide to override the existing contact data with the latest data sent. Our merchants have indicated they want us to send the invoice data as entered by the customer, but we cannot control how Xero receives that information. This is a learning point for many. Other API's may or may not do something similar. 

Order / Invoice Posting

Typically, in order to send an order/invoice to a third party API, we must have valid API codes for every product and the customer. Some API's let us send cash sales or adhoc customers, and they deal with what gets received. But sometimes you get seeminly duplicate records, because the customers name was typed differently, or abrieviated or something like that. It is always best that customers are synced well inadvance, to ensure the most customers are prelinked, thus preventing duplicate data. 

The same rule applies for stock. It is best that stock is presynced, so that you don't end up with duplicate stock records in your inventory system. We must create stock records if they don't exist, or can't be synced at the last minute. Otherwise, the invoice posting would be rejected. 

We typically post as much data as the API easily allows. The API may have capacity to receive more data, but it can be programatically challenging to sync additional records at the time of a sale, and ensure no API errors during an invoice POST. You can request additional API integration options for a development fee. 

If our system gets an error when posting an Invoice, it will send you an email notification of the error. This gives you a chance to tidy up any configuration options. Then the queue will attempt to resend the invoice every few hours. Eventually it will give up, to ensure that we don't keep banging on a locked door. 

API Limits

Most API's have limits of how many calls we can make in a minute, hour, day, or month. Customers underestimate how many API calls it takes to keep 2 systems synchronised. Usually it takes a minimum of 5000 API calls a month to keep systems in sync. Depending on the size of your database, you may need to request additional syncs for more timely data. This will require you are on a higher hosting plan, on both our end, and possibly also pay for the increased limits at the other end too.   This is why we have created what we think is the most efficient sync, which does not always mean every item has an up to date timestamp. 

Index Previous