Complete inventory tracking, stock updates, ABC analysis patterns, and slow-mover detection using direct Wix REST API calls.
From wix-ecom-coworknpx claudepluginhub itayher/wix-ecom-cowork --plugin wix-ecom-coworkThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Complete inventory tracking, stock updates, ABC analysis patterns, and slow-mover detection using direct Wix REST API calls.
df7c18eb-009b-4868-9891-15e19dddbe67${API_KEY}${SITE_ID}Endpoint: POST https://www.wixapis.com/stores/v2/inventoryItems/query
API Call:
curl -X POST "https://www.wixapis.com/stores/v2/inventoryItems/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"paging": {
"limit": 100,
"offset": 0
}
}
}'
Response:
{
"inventoryItems": [
{
"id": "inv-item-123",
"productId": "product-abc",
"trackQuantity": true,
"variants": [
{
"variantId": "variant-001",
"inStock": true,
"quantity": 50
}
]
}
],
"metadata": {
"count": 100,
"offset": 0,
"total": 450
}
}
curl -X GET "https://www.wixapis.com/stores/v2/inventoryItems/product/${PRODUCT_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Accept: application/json"
Response:
{
"inventoryItem": {
"id": "inv-item-123",
"productId": "product-abc",
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"inStock": true,
"quantity": 75,
"availableForPreorder": false
}
],
"lastUpdated": "2026-02-21T10:30:00.000Z"
}
}
Endpoint: PATCH https://www.wixapis.com/stores/v2/inventoryItems/product/{productId}
Update Quantity:
curl -X PATCH "https://www.wixapis.com/stores/v2/inventoryItems/product/${PRODUCT_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"inventoryItem": {
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 100,
"inStock": true
}
]
}
}'
Response:
{
"inventoryItem": {
"id": "inv-item-123",
"productId": "product-abc",
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"inStock": true,
"quantity": 100
}
]
}
}
curl -X PATCH "https://www.wixapis.com/stores/v2/inventoryItems/product/${PRODUCT_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"inventoryItem": {
"trackQuantity": true,
"variants": [
{
"variantId": "variant-001",
"quantity": 50,
"inStock": true
},
{
"variantId": "variant-002",
"quantity": 25,
"inStock": true
},
{
"variantId": "variant-003",
"quantity": 0,
"inStock": false
}
]
}
}'
curl -X PATCH "https://www.wixapis.com/stores/v2/inventoryItems/product/${PRODUCT_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"inventoryItem": {
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 0,
"inStock": false
}
]
}
}'
Endpoint: POST https://www.wixapis.com/stores/v2/inventoryItems/increment
curl -X POST "https://www.wixapis.com/stores/v2/inventoryItems/increment" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"incrementData": {
"productId": "product-abc",
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 10
}
}'
Response:
{
"inventoryItem": {
"productId": "product-abc",
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 85,
"inStock": true
}
]
}
}
Endpoint: POST https://www.wixapis.com/stores/v2/inventoryItems/decrement
curl -X POST "https://www.wixapis.com/stores/v2/inventoryItems/decrement" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"decrementData": {
"productId": "product-abc",
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 5
}
}'
Response:
{
"inventoryItem": {
"productId": "product-abc",
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 80,
"inStock": true
}
]
}
}
Query products with inventory below threshold (10 units):
curl -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"stock.trackInventory\": true, \"stock.quantity\": {\"$lte\": 10}, \"stock.inStock\": true}",
"sort": "{\"stock.quantity\": \"asc\"}",
"paging": {"limit": 100}
}
}'
Response includes products sorted by lowest stock first:
{
"products": [
{
"id": "product-001",
"name": "Product A",
"price": 29.99,
"stock": {
"trackInventory": true,
"quantity": 3,
"inStock": true
}
},
{
"id": "product-002",
"name": "Product B",
"price": 39.99,
"stock": {
"trackInventory": true,
"quantity": 7,
"inStock": true
}
}
]
}
curl -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"stock.inStock\": false, \"visible\": true}",
"paging": {"limit": 100}
}
}'
curl -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"stock.trackInventory\": false}",
"paging": {"limit": 100}
}
}'
Query products with inventory above threshold (500 units):
curl -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"stock.trackInventory\": true, \"stock.quantity\": {\"$gte\": 500}}",
"sort": "{\"stock.quantity\": \"desc\"}",
"paging": {"limit": 50}
}
}'
ABC analysis categorizes inventory based on value and turnover:
curl -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"stock.trackInventory\": true}",
"paging": {"limit": 100}
}
}' | jq '[.products[] | {id, name, price, quantity: .stock.quantity, value: (.price * .stock.quantity)}]'
#!/bin/bash
# Get all products
response=$(curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"stock.trackInventory\": true}", "paging": {"limit": 100}}}')
# Calculate total inventory value
total_value=$(echo "$response" | jq '[.products[] | .price * .stock.quantity] | add')
echo "Total inventory value: $total_value"
# Sort products by inventory value (price × quantity)
echo "$response" | jq '[.products[] | {
id,
name,
price,
quantity: .stock.quantity,
value: (.price * .stock.quantity),
value_pct: ((.price * .stock.quantity) / '"$total_value"' * 100)
}] | sort_by(-.value)'
#!/bin/bash
# A items: Top 20% by value (cumulative 80% revenue)
# B items: Next 30% by value (cumulative 15% revenue)
# C items: Bottom 50% by value (cumulative 5% revenue)
response=$(curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"stock.trackInventory\": true}", "paging": {"limit": 100}}}')
echo "$response" | jq -r '
[.products[] | {
id,
name,
price,
quantity: .stock.quantity,
value: (.price * .stock.quantity)
}] |
sort_by(-.value) |
to_entries |
map(. + {cumulative_pct: ([.[:(.key + 1)][] | .value.value] | add) / ([.[] | .value.value] | add) * 100}) |
map(.value + {
category: (
if .cumulative_pct <= 80 then "A"
elif .cumulative_pct <= 95 then "B"
else "C"
end
),
cumulative_pct: (.cumulative_pct | tostring | .[0:5])
}) |
.[]
' | jq -s 'group_by(.category) | map({category: .[0].category, count: length, items: .})'
Note: This requires combining API data with sales analytics. Use product query + external sales data.
#!/bin/bash
# Get products with high inventory (>100 units)
curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"stock.trackInventory\": true, \"stock.quantity\": {\"$gte\": 100}}",
"sort": "{\"stock.quantity\": \"desc\"}",
"paging": {"limit": 100}
}
}' | jq '[.products[] | {
id,
name,
price,
quantity: .stock.quantity,
value: (.price * .stock.quantity)
}]'
Recommendation: Cross-reference with Trino analytics:
-- Get products with high stock but low 90-day sales
SELECT
p.product_id,
p.product_name,
p.current_stock,
COALESCE(s.units_sold_90d, 0) as units_sold_90d,
p.current_stock / NULLIF(s.units_sold_90d, 0) as months_of_supply
FROM inventory_snapshot p
LEFT JOIN sales_90d s ON p.product_id = s.product_id
WHERE p.current_stock > 100
AND COALESCE(s.units_sold_90d, 0) < 10
ORDER BY months_of_supply DESC;
Formula: Reorder Point = (Average Daily Sales × Lead Time Days) + Safety Stock
#!/bin/bash
# Get current inventory
products=$(curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"stock.trackInventory\": true}", "paging": {"limit": 100}}}')
# Calculate reorder points (requires sales data)
# Example: Average daily sales = 2 units, Lead time = 7 days, Safety stock = 5 units
# Reorder point = (2 × 7) + 5 = 19 units
echo "$products" | jq '[.products[] | {
id,
name,
current_stock: .stock.quantity,
reorder_point: 19,
status: (if .stock.quantity <= 19 then "REORDER NOW" else "OK" end)
}] | sort_by(.current_stock)'
#!/bin/bash
# Update inventory for multiple products
products=("product-001" "product-002" "product-003")
quantities=(50 75 100)
for i in "${!products[@]}"; do
product_id="${products[$i]}"
quantity="${quantities[$i]}"
curl -s -X PATCH "https://www.wixapis.com/stores/v2/inventoryItems/product/${product_id}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"inventoryItem\": {
\"trackQuantity\": true,
\"variants\": [
{
\"variantId\": \"00000000-0000-0000-0000-000000000000\",
\"quantity\": $quantity,
\"inStock\": true
}
]
}
}" | jq '{id: .inventoryItem.productId, quantity: .inventoryItem.variants[0].quantity}'
sleep 0.2 # Rate limiting
done
#!/bin/bash
# Get all discontinued products (tagged as "discontinued")
discontinued=$(curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"ribbon\": \"Discontinued\"}", "paging": {"limit": 100}}}')
# Set inventory to 0 and mark as out of stock
echo "$discontinued" | jq -r '.products[].id' | while read product_id; do
curl -s -X PATCH "https://www.wixapis.com/stores/v2/inventoryItems/product/${product_id}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"inventoryItem": {
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 0,
"inStock": false
}
]
}
}' > /dev/null
echo "Zeroed out: $product_id"
sleep 0.2
done
#!/bin/bash
curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"stock.trackInventory\": true}", "paging": {"limit": 100}}}' | \
jq -r '
[.products[] | {
name,
quantity: .stock.quantity,
price,
value: (.price * .stock.quantity)
}] |
"INVENTORY VALUATION REPORT",
"=" * 80,
"Product Name | Quantity | Price | Total Value",
"-" * 80,
(.[] | "\(.name) | \(.quantity) | $\(.price) | $\(.value)"),
"-" * 80,
"TOTAL VALUE: $\([.[] | .value] | add)"
'
Note: Requires historical data. Use Trino analytics:
SELECT
product_id,
product_name,
DATE(created_date) as date,
SUM(quantity_change) as net_movement,
SUM(CASE WHEN quantity_change > 0 THEN quantity_change ELSE 0 END) as stock_in,
SUM(CASE WHEN quantity_change < 0 THEN ABS(quantity_change) ELSE 0 END) as stock_out
FROM inventory_transactions
WHERE created_date >= CURRENT_DATE - INTERVAL '30' DAY
GROUP BY product_id, product_name, DATE(created_date)
ORDER BY date DESC;
#!/bin/bash
# Check for critical stock levels daily
critical_products=$(curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"stock.trackInventory\": true, \"stock.quantity\": {\"$lte\": 5}}", "paging": {"limit": 100}}}')
count=$(echo "$critical_products" | jq '.products | length')
if [ "$count" -gt 0 ]; then
echo "⚠️ ALERT: $count products at critical stock levels!"
echo "$critical_products" | jq -r '.products[] | "- \(.name): \(.stock.quantity) units remaining"'
fi
#!/bin/bash
# Get all products not tracking inventory
products=$(curl -s -X POST "https://www.wixapis.com/stores/v1/products/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"filter": "{\"stock.trackInventory\": false}", "paging": {"limit": 100}}}')
# Enable tracking with default quantity
echo "$products" | jq -r '.products[].id' | while read product_id; do
curl -s -X PATCH "https://www.wixapis.com/stores/v2/inventoryItems/product/${product_id}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"inventoryItem": {
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"quantity": 0,
"inStock": false
}
]
}
}' > /dev/null
echo "Enabled tracking: $product_id"
sleep 0.2
done