Managing inventory sync
This guide focuses on integration using APIs. We recommend using the
Event Stream webhooks instead, see Managing inventory sync with the Event stream .If you work with an ERP that manages fulfillment and no other applications in your project need fulfillment-related data, you do not need this guide. Instead, refer toIntegrating a fulfillment provider and Importing data .
Syncing inventory is a continual 2-way process that involves:
How inventory sync works​
To sync inventory changes from your business into NewStore Omnichannel Cloud, develop an adapter. An adapter serves as an intermediary integration layer that communicates directly with NewStore Omnichannel Cloud on one side and with business applications that you want to integrate NewStore with, on the other.
Let's assume your product stock is 10. If 4 items of this product were shipped as part of different orders, here's how inventory will be synced.
The workflow is as follows:
- NewStore sends fulfillment data items to an adapter via fulfillment request events with logical timestamps to identify the items that failed, were assigned or were completed.
- The adapter syncs inventory changes and remove allocations in your business.
- On NewStore side, when you import stock into NewStore, include a range of logical timestamps for which to remove allocations.
When an item is shipped, the fulfillment_request_completed
part of the
Fulfillment request events
webhook is published. Each fulfillment event in NewStore is associated
with a logical timestamp. A logical timestamp is a number that
consistently increases and helps arrange fulfillment events in the
sequence in which they occurred. If fulfillment events ff1, ff2, ff3,
and ff4 are assigned logical timestamps 10, 11, 12, 13 respectively
where 13 is the highest, ff4 is the most recently fulfilled item.
When an item is shipped, allocation
for the associated item is removed
from NewStore Omnichannel Cloud.
Syncing inventory​
Here's a quick overview of the methods to implement and sync inventory between NewStore Omnichannel Cloud and other applications:
Syncing inventory to other applications​
Implement the Publish fulfillment request event method.
The webhook sends you data for the following events:
fulfillment_request_assigned
: Contains details of the fulfillment request that was assigned to a fulfillment location. The item identified in this event can either fail or be completed.fulfillment_request_failed
: Contains details of the fulfillment request that failed. Allocations on items in fulfillment requests that failed are automatically removed in NewStore.fulfillment_request_completed
: Contains details of the completed fulfillment request.
The number of completed fulfillment requests are an indication of the allocations that can be removed. After the allocations are removed in your business, you are ready to sync inventory back into NewStore Omnichannel Cloud.
Syncing inventory to NewStore Omnichannel Cloud​
Use the import job to sync inventory into NewStore Omnichannel Cloud. Use the prescribed JSON schema for stock. As soon as items are shipped, allocations for the items are removed from NewStore Omnichannel Cloud.
Inventory in NewStore Omnichannel Cloud and in your business are now in sync.
Related topics