Hi Anders
For inventory bulk update I wouldn't go with Service API, instead you can use IWarehouseInventoryService.Save(IEnumerable<IWarehouseInventory> inventories) method that accepts a list of inventories. Alternatively, you can use IInventoryService.Save(IEnumerable<InventoryRecord> records) as well
Just as Vincent said, you can easily add a new endpoint to update inventories of multiple SKUs at once (however, arguably that's no longer RESTful). The SKU (entry) is the resource and inventories and prices are parts of that resource. It's be tricky if you design that endpoint, but if you ignore some RESTful rules then it's doable. I do think that a scheduled job is a better fit for such job - both for inventories and prices. Just one note: IWarehouseInventoryService and IWarehouseInventory are obsolete and removed in later version, you should stick with IInventoryService/InventoryRecord
Thank you for your help. I guess that is the way to go.
I guess I was just hoping that the Service API could do more than it actually can.
@Quan Mai: Well, I don't know if the Catalog Import is very RESTful. But it can be very useful :)
Can I use the Catalog Import to update inventory, by only specifying Code of the Entry and the updated WarehouseInventory element(s)?
It may not be intuitive, but if it works and performs well, this may be what we need.
We probably need to invest in understanding the Catalog.xml format anyway to update our product catalog from our PIM system. So if we can also use it to update inventory based on updates from ERP, this may be ok. But we will need separate integration flows (with separate data), since catalog and inventory updates will come from separate systems.
We don't expect to store prices in Optimizely commerce, since our price logic is completely custom for our B2B scenario. We have customer-specific prices on most of the items, and it must match the business logic from the ERP system.
We are starting a new Commerce project, and are currently planning our integration strategy. We would like to use the Service API as much as possible to have a clean API towards Commerce. But I'm a bit concerned if this is the right approach.
Right now we are looking at inventory. Our inventory is managed by the ERP system, but for performance reasons we would like to syncrhonize inventory with Commerce often. Perhaps every 10 minutes if this is possible.
The only Inventory update API's I can see from the documentation are:
POST post/episerverapi/commerce/entries/{entryCode}/inventories
PUT put/episerverapi/commerce/entries/{entryCode}/inventories/{warehouseCode}
But both of these API's seem to update 1 inventory for 1 product. Are there no bulk operations for updating inventory? Or am I just looking the wrong place?
What then is the recommended approach to update inventory for many products at the same time?
Thank you for your help.
Regards
Anders