Tracking order updates with the Zentail Open API

Last updated 02/19/2021

This guide will outline how to use the Open API to retrieve new and updated orders from Zentail.

Timestamp-Based

The recommended process is to keep a timestamp in your code which keeps track of the last time you requested orders. Sending this timestamp (A small buffer of 5 minutes is suggested) to the GET /salesOrder endpoint in the lastUpdatedTs will retrieve all orders that have been created or modified since the provided timestamp. See the timestamp guide for more information on formatting and working with timestamps.

Example providing lastUpdatedTs:

shell
curl -X GET "https://api.zentail.com/v1/salesOrder?lastUpdatedTs=2019-05-08T17%3A01%3A16.152Z" \ -H "accept: application/json" \ -H "AUTHORIZATION: <your token here>"

Other Filters

If there are only certain kinds of orders you are interested in, it is also possible to provide a status filter. The current order statuses provided are:

PENDING_PAYMENT, PENDING, SHIPPED, CANCELLED, RETURNED, REFUNDED, RETURN_REQUESTED

For instance, if you are a shipping software you may only care about PENDING_PAYMENT, PENDING and CANCELLED orders. See the following example request which provides both status and last updated timestamp:

shell
curl -X GET "https://api.zentail.com/v1/salesOrder?lastUpdatedTs=2019-05-08T17%3A01%3A16.152Z&status=PENDING_PAYMENT,PENDING,CANCELLED" \ -H "accept: application/json" \ -H "AUTHORIZATION: <your token here>"

You can consult our docs for the other filters available.

Paging

Keep in mind that the responses to GET /salesOrder will be paged, the default page size is 25 but it can be set up to 100. For more info on paging see the paging guide.

Was this section helpful?
Yes No