Skip to main content
PATCH
/
products
/
{productId}
/
inventory
Update Product Inventory
curl --request PATCH \
  --url https://staging-api.puppetvendors.com/products/{productId}/inventory \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "mode": "<string>",
  "updates": [
    {}
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://dev.puppetvendors.com/llms.txt

Use this file to discover all available pages before exploring further.

V2 Preview — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Inventory-only update designed for the vendor quick-view modal. Uses Shopify’s inventorySetQuantities (absolute) or inventoryAdjustQuantities (delta) depending on mode. Does not touch product/variant metadata — only the on-hand count.

Path Parameters

productId
string
required
Product ID (Shopify numeric, GID, or MongoDB ObjectId).

Request Body

mode
string
required
set (absolute) or adjust (delta).
updates
array
required
Array of { variantId, locationId, quantity } (for set) or { variantId, locationId, delta } (for adjust).

Response

200
{
  "success": true,
  "data": {
    "updated": 2,
    "errors": []
  }
}

Example

curl -X PATCH "https://staging-api.puppetvendors.com/products/507f1f77bcf86cd799439013/inventory" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "set",
    "updates": [
      { "variantId": "gid://shopify/ProductVariant/1", "locationId": "gid://shopify/Location/1", "quantity": 50 }
    ]
  }'

More Examples

Set inventory to exact quantity
curl -X PATCH "https://staging-api.puppetvendors.com/products/507f1f77bcf86cd799439013/inventory" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "set",
    "variants": [
      {
        "variantId": "gid://shopify/ProductVariant/123",
        "locationId": "gid://shopify/Location/456",
        "quantity": 100
      }
    ]
  }'
Adjust inventory (add 10 units)
curl -X PATCH "https://staging-api.puppetvendors.com/products/507f1f77bcf86cd799439013/inventory" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "adjust",
    "variants": [
      {
        "variantId": "gid://shopify/ProductVariant/123",
        "locationId": "gid://shopify/Location/456",
        "quantity": 10
      }
    ],
    "reason": "Restock from supplier"
  }'