Get product inventories
POST
/merchants/{merchantCode}/productInventories
const url = 'https://catalog.shopgate.io/v1/merchants/example/productInventories';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '[{"productCode":"someProductCode","locationCode":"LOCATION123"}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://catalog.shopgate.io/v1/merchants/example/productInventories \ --header 'Content-Type: application/json' \ --data '[ { "productCode": "someProductCode", "locationCode": "LOCATION123" } ]'This endpoint returns the inventories for the given product and location combination. It can be used to revalidate cart actions or to indicates stock changes in the cart.
The location can be null in order to get the cumulated inventory for this product.
Note: The location has to be set up first.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
Array<object>
object
productCode
required
Code of the product
string
Example
someProductCodelocationCode
Code of the location, can be null in order to get the cumulated inventory for this product.
null | string
Example
LOCATION123Responses
Section titled “Responses”OK
Media typeapplication/json
object
productInventories
Array<object>
object
productCode
Code of the product
string
locationCode
Code of the location
string
inventoryTreatmentSetting
object
code
required
string
name
required
string
isPurchasable
required
boolean
sequenceId
integer
isAvailable
This field indicates if a product is available or not. It combines all information of the inventory managment and the flags on the product
boolean
available
Available stock for this location
number
visible
Visible stock for this location
number
Example
{ "productInventories": [ { "productCode": "jeans-1", "locationCode": "LOCATION123", "inventoryTreatmentSetting": { "code": "its1", "name": "testName", "isPurchasable": true }, "isAvailable": true, "available": 10, "visible": 5 } ]}
