Correct API usage

When you’re preparing the addon, it is a good idea to think in advance, what data and in what intervals you really need them. A lot of data can be acquired efficiently without having to re-download everything, which is an unnecessary load for you and our hardware resources. At the same time, it is good to lay out, what data shall be regularly monitored for you, and distinguish between those that only need less frequent checks, for example by webhooks.

Use the Changes endpoints

For many endpoints, there are also endpoints for the changes themselves. It is therefore not necessary to download orders every 5 minutes, for example. Download them in much longer intervals and use the endpoints that work with changes in the meantime. You can also connect it with using webhooks, and again, instead of repeating requests, you just monitor the changes and download the necessary new data.

Use the access token correctly

When you install the addon, just confirm that you have saved the token and only request the necessary data when it is correctly installed and everything works fine. If you are doing more steps at once, and there is an installation error, you will encounter a token usage limit. You must wait 30 minutes before you can perform the installation again.
If you are unsure about the installation, let us know and we can review the entire installation process to help you launch it correctly.

Don’t rely on webhooks

The webhooks themselves send the info regularly, and if they fail, they’ll try to deliver the notification several more times. However, if any errors and notifications do not reach you, it is always a good idea to see, if there are any problems with data acquisition. You should possibly have a backup prepared in the form of changes downloads.

Process the requests in the queue

When you are getting various data in the form of requests, please consider the way of querying and then processing everything too. We will both profit from the data being processed in a queue rather than if you run it all at once.

Check the status codes

Sometimes some errors can be caused in the API, these are then reported using the status codes. Those containing a 5xx error code, are caused by an error/unexpected behavior on our side, and those containing a 4xx error code are caused by you – this includes those exceeding the API limits – these show the “429 Too Many Requests” error. It is therefore always a good idea to monitor, whether these status codes do not appear to you and, if so, to pay close attention to them.

Use the cache

The basis for using the API correctly, is working with the data you downloaded. Although you limit downloading complete data and rely on changes and webhooks, there will be data that does not need to be downloaded X-times a day and these requests can therefore have longer intervals.

Work with list endpoints

In addition to order details, products, etc., endpoints also have lists giving basic information. So it’s not always necessary to search for everything in order details, it is sufficient to get the data directly from the order list, thus saving yourself a few requests.

Use List of all products endpoint

Should you need a complete list of all products, use List of all products endpoint instead of calling a detail endpoint for each product. In the near future we will add also orders and other entities.

Update in batches

Many of our POST and PATCH endpoint accept array of entities to be processed within the request – try to use the maximum amount of changes sent at once. Sending one request with 20 changes will be faster than 20 requests with one change.

Ask for new features

If you need to obtain any information from API and you are missing the endpoint or the value contained in it, let us know and we will try to prepare it as soon as possible. If some data are missing, the solution is definitely not to try to bypass everything and exploit multiple APIs elsewhere.