GET
Get Stock by Product ID
https://api.moltin.com/v2/inventories/:productId
Parameters
Path parameters
Name | Required | Type | Description |
productId | Required | string | The ID for the product you require stock. |
Headers
Name | Required | Type | Description |
Authorization | Required | string | The Bearer token required to get access to the API. |
Request Examples
Curl
curl -X GET https://api.moltin.com/v2/inventories/:productId \
-H "Authorization: Bearer XXXX"
JavaScript SDK
const MoltinGateway = require("@moltin/sdk").gateway;
const Moltin = MoltinGateway({
client_id: "X",
});
const productId = "XXXX";
Moltin.Inventories.Get(productId).then((inventories) => {
});
Response Example
200 OK
{
"data": {
"id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
"type": "stock",
"total": 20,
"available": 20,
"allocated": 0
}
}
Last updated on 11/10/2022