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": [
{}
]
}
'import requests
url = "https://staging-api.puppetvendors.com/products/{productId}/inventory"
payload = {
"mode": "<string>",
"updates": [{}]
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: '<string>', updates: [{}]})
};
fetch('https://staging-api.puppetvendors.com/products/{productId}/inventory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.puppetvendors.com/products/{productId}/inventory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'updates' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-api.puppetvendors.com/products/{productId}/inventory"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"updates\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://staging-api.puppetvendors.com/products/{productId}/inventory")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"updates\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.puppetvendors.com/products/{productId}/inventory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"updates\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyProducts
Update Product Inventory
Inventory-only update without touching product/variant data
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": [
{}
]
}
'import requests
url = "https://staging-api.puppetvendors.com/products/{productId}/inventory"
payload = {
"mode": "<string>",
"updates": [{}]
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: '<string>', updates: [{}]})
};
fetch('https://staging-api.puppetvendors.com/products/{productId}/inventory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.puppetvendors.com/products/{productId}/inventory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'updates' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-api.puppetvendors.com/products/{productId}/inventory"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"updates\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://staging-api.puppetvendors.com/products/{productId}/inventory")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"updates\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.puppetvendors.com/products/{productId}/inventory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"updates\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyV2 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’sinventorySetQuantities (absolute) or inventoryAdjustQuantities (delta) depending on mode. Does not touch product/variant metadata — only the on-hand count.
Path Parameters
Product ID (Shopify numeric, GID, or MongoDB ObjectId).
Request Body
set (absolute) or adjust (delta).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 quantitycurl -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
}
]
}'
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"
}'
Was this page helpful?
⌘I