This guide will outline how to use the Open API to retrieve new and updated orders from Zentail.
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
endpoint in the
lastUpdatedTs will retrieve all orders that have been created or modified since the provided timestamp.
the timestamp guide
for more information on formatting and working with timestamps.
shellcurl -X GET "https://api.zentail.com/v1/salesOrder?lastUpdatedTs=2019-05-08T17%3A01%3A16.152Z" \ -H "accept: application/json" \ -H "AUTHORIZATION: <your token here>"
lastUpdatedTs is different from
orderTs is the time the order was placed and will not change when it is updated.
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
if you are a shipping software you may only care about
See the following example
request which provides both status and last updated timestamp:
shellcurl -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.