Starting with Version 1.3 of our WooCommerce Multi Inventory Plugin we offer a built in REST API functionality. This allows vendors or other customers to fetch multi inventory stocks, locations and more.

REST API Base

The Base for all multi inventory calls of our API is “/wc/multi-inventory/v1/”. A full call would include also your site URL and wp-json of course.

This is an example full base:

https://www.YOURDOMAIN.COM/wp-json/wc/multi-inventory/v1/inventories?consumer_key=YOUR_KEY&consumer_secret=YOUR_KEY

Get Inventories

The first REST API Call is to get all inventory locations.

/wp-json/wc/multi-inventory/v1/inventories

Get Product Inventory Stocks

To get the inventory stock data for a product you can use the stock call. Parameters for the call are: sku or product_id. Example:

/wp-json/wc/multi-inventory/v1/stock?sku=123

Parameters:

sku OR product_id

Update Product Inventory Stocks

To update a product with inventory stock information use the stock call as POST.

/wp-json/wc/multi-inventory/v1/stock?inventory=71&sku=123&inventory=71

Parameters:

sku OR product_id
stock
inventory (inventory id)

Get Inventory Orders

If you need all orders by inventory ID, use the orders call. Parameter is inventory (containing your inventory ID).

/wp-json/wc/multi-inventory/v1/orders?inventory=71

Leave a Reply

Your email address will not be published.