Open API v2 / Custom Modules / Module Item Inventory
Module Item Inventory
→
Every request needs a bearer token: Authorization: Bearer <token>. Base URL https://your-site.webinone.com. New to field types? See the type reference.
Discards existing module item inventory variations
Parameters
moduleItemIdinteger · pathrequired
Module item id.
curl -X DELETE "https://your-site.webinone.com/api/v2/admin/module-items/1/discard-variations" \ -H "Authorization: Bearer <token>"
await fetch("https://your-site.webinone.com/api/v2/admin/module-items/1/discard-variations", { method: "DELETE", headers: { "Authorization": "Bearer <token>" } });
import requests requests.delete( "https://your-site.webinone.com/api/v2/admin/module-items/1/discard-variations", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('DELETE', 'https://your-site.webinone.com/api/v2/admin/module-items/1/discard-variations', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Delete, "https://your-site.webinone.com/api/v2/admin/module-items/1/discard-variations"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Generates module item inventory variations
Parameters
moduleItemIdinteger · pathrequired
Module item id.
Response
Enabledboolean
Whether enabled is on.
LowStockNotificationinteger
Stock threshold at or below which a low-stock notification is triggered.
HasAttributesboolean
Indicates whether the item has product attributes (such as size or color) that split its inventory into variants.
WhenOutOfStockenum
Behavior applied to the product once its stock reaches zero. Possible values: HideProduct, EnablePreOrdering, ShowButNotAcceptOrders.Possible values: HideProductEnablePreOrderingShowButNotAcceptOrders
HasGeneratedInventoryProductsboolean
Indicates whether variant inventory records have been generated from the item's attribute combinations.
InventoryProductsarray of objects
Per-variant inventory records, each tracking its own stock, SKU, and pre-order allowance.
Idinteger
Unique identifier assigned by the platform.
SKUCodestring · nullable
Stock Keeping Unit code identifying this inventory variant.
InStockinteger
Current number of units of this variant available in stock.
Enabledboolean
Whether enabled is on.
Titlestring · nullable
Display name of this inventory variant (typically its attribute combination).
PreOrderinteger
Number of units of this variant available for pre-order beyond current stock.
curl -X PUT "https://your-site.webinone.com/api/v2/admin/module-items/1/generate-variations" \ -H "Authorization: Bearer <token>"
await fetch("https://your-site.webinone.com/api/v2/admin/module-items/1/generate-variations", { method: "PUT", headers: { "Authorization": "Bearer <token>" } });
import requests requests.put( "https://your-site.webinone.com/api/v2/admin/module-items/1/generate-variations", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('PUT', 'https://your-site.webinone.com/api/v2/admin/module-items/1/generate-variations', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://your-site.webinone.com/api/v2/admin/module-items/1/generate-variations"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Response · 200
{
"Enabled": false,
"LowStockNotification": 0,
"HasAttributes": false,
"WhenOutOfStock": "HideProduct",
"HasGeneratedInventoryProducts": false,
"InventoryProducts": [
{
"Id": 1,
"SKUCode": "string",
"InStock": 0,
"Enabled": false,
"Title": "string",
"PreOrder": 0
}
]
}Retrieves a module item inventory
Parameters
moduleItemIdinteger · pathrequired
Module item id.
Response
Enabledboolean
Whether enabled is on.
LowStockNotificationinteger
Stock threshold at or below which a low-stock notification is triggered.
HasAttributesboolean
Indicates whether the item has product attributes (such as size or color) that split its inventory into variants.
WhenOutOfStockenum
Behavior applied to the product once its stock reaches zero. Possible values: HideProduct, EnablePreOrdering, ShowButNotAcceptOrders.Possible values: HideProductEnablePreOrderingShowButNotAcceptOrders
HasGeneratedInventoryProductsboolean
Indicates whether variant inventory records have been generated from the item's attribute combinations.
InventoryProductsarray of objects
Per-variant inventory records, each tracking its own stock, SKU, and pre-order allowance.
Idinteger
Unique identifier assigned by the platform.
SKUCodestring · nullable
Stock Keeping Unit code identifying this inventory variant.
InStockinteger
Current number of units of this variant available in stock.
Enabledboolean
Whether enabled is on.
Titlestring · nullable
Display name of this inventory variant (typically its attribute combination).
PreOrderinteger
Number of units of this variant available for pre-order beyond current stock.
curl "https://your-site.webinone.com/api/v2/admin/module-items/1/inventory" \ -H "Authorization: Bearer <token>"
await fetch("https://your-site.webinone.com/api/v2/admin/module-items/1/inventory", { method: "GET", headers: { "Authorization": "Bearer <token>" } });
import requests requests.get( "https://your-site.webinone.com/api/v2/admin/module-items/1/inventory", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('GET', 'https://your-site.webinone.com/api/v2/admin/module-items/1/inventory', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://your-site.webinone.com/api/v2/admin/module-items/1/inventory"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Response · 200
{
"Enabled": false,
"LowStockNotification": 0,
"HasAttributes": false,
"WhenOutOfStock": "HideProduct",
"HasGeneratedInventoryProducts": false,
"InventoryProducts": [
{
"Id": 1,
"SKUCode": "string",
"InStock": 0,
"Enabled": false,
"Title": "string",
"PreOrder": 0
}
]
}Updates an existing module item inventory
Parameters
moduleItemIdinteger · pathrequired
Module item id.
Body parameters
Enabledboolean
Whether enabled is on.
LowStockNotificationinteger
Stock threshold at or below which a low-stock notification is triggered.
WhenOutOfStockenum
Behavior applied to the product once its stock reaches zero. Possible values: HideProduct, EnablePreOrdering, ShowButNotAcceptOrders.Possible values: HideProductEnablePreOrderingShowButNotAcceptOrders
InventoryProductsarray of objects
Per-variant inventory records to set, each with its own stock, SKU, and pre-order allowance.
Idinteger
Unique identifier assigned by the platform.
SKUCodestring · nullable
Stock Keeping Unit code identifying this inventory variant.
InStockinteger
Number of units of this variant to record as available in stock.
Enabledboolean
Whether enabled is on.
Titlestring · nullable
Display name of this inventory variant (typically its attribute combination).
PreOrderinteger
Number of units of this variant to make available for pre-order beyond current stock.
Response
Enabledboolean
Whether enabled is on.
LowStockNotificationinteger
Stock threshold at or below which a low-stock notification is triggered.
HasAttributesboolean
Indicates whether the item has product attributes (such as size or color) that split its inventory into variants.
WhenOutOfStockenum
Behavior applied to the product once its stock reaches zero. Possible values: HideProduct, EnablePreOrdering, ShowButNotAcceptOrders.Possible values: HideProductEnablePreOrderingShowButNotAcceptOrders
HasGeneratedInventoryProductsboolean
Indicates whether variant inventory records have been generated from the item's attribute combinations.
InventoryProductsarray of objects
Per-variant inventory records, each tracking its own stock, SKU, and pre-order allowance.
Idinteger
Unique identifier assigned by the platform.
SKUCodestring · nullable
Stock Keeping Unit code identifying this inventory variant.
InStockinteger
Current number of units of this variant available in stock.
Enabledboolean
Whether enabled is on.
Titlestring · nullable
Display name of this inventory variant (typically its attribute combination).
PreOrderinteger
Number of units of this variant available for pre-order beyond current stock.
curl -X PUT "https://your-site.webinone.com/api/v2/admin/module-items/1/inventory" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"Enabled":false,"LowStockNotification":0,"WhenOutOfStock":"HideProduct","InventoryProducts":[{"Id":1,"SKUCode":"string","InStock":0,"Enabled":false,"Title":"string","PreOrder":0}]}'
await fetch("https://your-site.webinone.com/api/v2/admin/module-items/1/inventory", { method: "PUT", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "Enabled": false, "LowStockNotification": 0, "WhenOutOfStock": "HideProduct", "InventoryProducts": [ { "Id": 1, "SKUCode": "string", "InStock": 0, "Enabled": false, "Title": "string", "PreOrder": 0 } ] }) });
import requests requests.put( "https://your-site.webinone.com/api/v2/admin/module-items/1/inventory", headers={"Authorization": "Bearer <token>"}, json={ "Enabled": False, "LowStockNotification": 0, "WhenOutOfStock": "HideProduct", "InventoryProducts": [{ "Id": 1, "SKUCode": "string", "InStock": 0, "Enabled": False, "Title": "string", "PreOrder": 0 }] } )
$client = new GuzzleHttp\Client(); $response = $client->request('PUT', 'https://your-site.webinone.com/api/v2/admin/module-items/1/inventory', [ 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json' ], 'json' => [ 'Enabled' => false, 'LowStockNotification' => 0, 'WhenOutOfStock' => 'HideProduct', 'InventoryProducts' => [[ 'Id' => 1, 'SKUCode' => 'string', 'InStock' => 0, 'Enabled' => false, 'Title' => 'string', 'PreOrder' => 0 ]] ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://your-site.webinone.com/api/v2/admin/module-items/1/inventory"); request.Headers.Add("Authorization", "Bearer <token>"); request.Content = new StringContent( "{\"Enabled\":false,\"LowStockNotification\":0,\"WhenOutOfStock\":\"HideProduct\",\"InventoryProducts\":[{\"Id\":1,\"SKUCode\":\"string\",\"InStock\":0,\"Enabled\":false,\"Title\":\"string\",\"PreOrder\":0}]}", Encoding.UTF8, "application/json"); var response = await client.SendAsync(request);
Response · 200
{
"Enabled": false,
"LowStockNotification": 0,
"HasAttributes": false,
"WhenOutOfStock": "HideProduct",
"HasGeneratedInventoryProducts": false,
"InventoryProducts": [
{
"Id": 1,
"SKUCode": "string",
"InStock": 0,
"Enabled": false,
"Title": "string",
"PreOrder": 0
}
]
}