Get a Product's Stock

get
Get All Stock by Product ID

https://api.moltin.com/v2/inventories/:productId
Request
Response
Path Parameters
productId
required
string
The ID for the product you require stock
Headers
Authorization
required
string
The Bearer token to grant access to the API
200: OK
You will get the following response when you perform any of the
{
"data": {
"id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
"type": "stock",
"total": 20,
"available": 20,
"allocated": 0
}
}
cURL
JavaScript SDK
Moltin Request
curl -X GET https://api.moltin.com/v2/inventories/:productId \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const productId = 'XXXX'
Moltin.Inventories.Get(productId).then(inventories => {
// Do something
})
const { createClient } = require('@moltin/request')
const client = new createClient({
client_id: 'X'
})
const productId = 'XXXX'
client
.get(`inventories/${productId}`)
.then(inventory => {
// Do something...
})
.catch(console.error)