curl --request PUT \
--url https://production-api.puppetvendors.com/products/{productId} \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"title": "Widget Pro Deluxe v2",
"descriptionHtml": "<string>",
"vendorId": "507f1f77bcf86cd799439011",
"productType": "<string>",
"tags": [
"<string>"
],
"handle": "<string>",
"options": [
{
"name": "Color",
"values": [
"Red",
"Blue",
"Green"
]
}
],
"variants": [
{
"optionValues": [
{
"name": "Color",
"value": "Red"
}
],
"price": "29.99",
"compareAtPrice": "39.99",
"sku": "WIDGET-RED-L",
"barcode": "<string>",
"inventoryQuantity": 100,
"locationId": "gid://shopify/Location/123456",
"requiresShipping": true,
"taxable": true,
"inventoryPolicy": "DENY"
}
],
"metafields": [
{
"namespace": "custom",
"key": "color_family",
"value": "red",
"type": "single_line_text_field",
"description": "<string>"
}
],
"seo": {
"title": "Premium Widget - Best Price Online",
"description": "High-quality widgets at competitive prices. Free shipping on orders over $50."
},
"category": "<string>",
"templateSuffix": "<string>",
"images": [
{
"src": "https://cdn.example.com/widget.jpg",
"altText": "<string>"
}
],
"medias": [
{
"file": "<string>",
"name": "<string>",
"size": 1,
"type": "<string>",
"variant": "<string>",
"variantId": "<string>",
"assignedTo": "<string>"
}
],
"vendor": "<string>",
"brandName": "<string>",
"collections": [
"<string>"
],
"isDigital": true
}
'import requests
url = "https://production-api.puppetvendors.com/products/{productId}"
payload = {
"title": "Widget Pro Deluxe v2",
"descriptionHtml": "<string>",
"vendorId": "507f1f77bcf86cd799439011",
"productType": "<string>",
"tags": ["<string>"],
"handle": "<string>",
"options": [
{
"name": "Color",
"values": ["Red", "Blue", "Green"]
}
],
"variants": [
{
"optionValues": [
{
"name": "Color",
"value": "Red"
}
],
"price": "29.99",
"compareAtPrice": "39.99",
"sku": "WIDGET-RED-L",
"barcode": "<string>",
"inventoryQuantity": 100,
"locationId": "gid://shopify/Location/123456",
"requiresShipping": True,
"taxable": True,
"inventoryPolicy": "DENY"
}
],
"metafields": [
{
"namespace": "custom",
"key": "color_family",
"value": "red",
"type": "single_line_text_field",
"description": "<string>"
}
],
"seo": {
"title": "Premium Widget - Best Price Online",
"description": "High-quality widgets at competitive prices. Free shipping on orders over $50."
},
"category": "<string>",
"templateSuffix": "<string>",
"images": [
{
"src": "https://cdn.example.com/widget.jpg",
"altText": "<string>"
}
],
"medias": [
{
"file": "<string>",
"name": "<string>",
"size": 1,
"type": "<string>",
"variant": "<string>",
"variantId": "<string>",
"assignedTo": "<string>"
}
],
"vendor": "<string>",
"brandName": "<string>",
"collections": ["<string>"],
"isDigital": True
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Widget Pro Deluxe v2',
descriptionHtml: '<string>',
vendorId: '507f1f77bcf86cd799439011',
productType: '<string>',
tags: ['<string>'],
handle: '<string>',
options: [{name: 'Color', values: ['Red', 'Blue', 'Green']}],
variants: [
{
optionValues: [{name: 'Color', value: 'Red'}],
price: '29.99',
compareAtPrice: '39.99',
sku: 'WIDGET-RED-L',
barcode: '<string>',
inventoryQuantity: 100,
locationId: 'gid://shopify/Location/123456',
requiresShipping: true,
taxable: true,
inventoryPolicy: 'DENY'
}
],
metafields: [
{
namespace: 'custom',
key: 'color_family',
value: 'red',
type: 'single_line_text_field',
description: '<string>'
}
],
seo: {
title: 'Premium Widget - Best Price Online',
description: 'High-quality widgets at competitive prices. Free shipping on orders over $50.'
},
category: '<string>',
templateSuffix: '<string>',
images: [{src: 'https://cdn.example.com/widget.jpg', altText: '<string>'}],
medias: [
{
file: '<string>',
name: '<string>',
size: 1,
type: '<string>',
variant: '<string>',
variantId: '<string>',
assignedTo: '<string>'
}
],
vendor: '<string>',
brandName: '<string>',
collections: ['<string>'],
isDigital: true
})
};
fetch('https://production-api.puppetvendors.com/products/{productId}', 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://production-api.puppetvendors.com/products/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Widget Pro Deluxe v2',
'descriptionHtml' => '<string>',
'vendorId' => '507f1f77bcf86cd799439011',
'productType' => '<string>',
'tags' => [
'<string>'
],
'handle' => '<string>',
'options' => [
[
'name' => 'Color',
'values' => [
'Red',
'Blue',
'Green'
]
]
],
'variants' => [
[
'optionValues' => [
[
'name' => 'Color',
'value' => 'Red'
]
],
'price' => '29.99',
'compareAtPrice' => '39.99',
'sku' => 'WIDGET-RED-L',
'barcode' => '<string>',
'inventoryQuantity' => 100,
'locationId' => 'gid://shopify/Location/123456',
'requiresShipping' => true,
'taxable' => true,
'inventoryPolicy' => 'DENY'
]
],
'metafields' => [
[
'namespace' => 'custom',
'key' => 'color_family',
'value' => 'red',
'type' => 'single_line_text_field',
'description' => '<string>'
]
],
'seo' => [
'title' => 'Premium Widget - Best Price Online',
'description' => 'High-quality widgets at competitive prices. Free shipping on orders over $50.'
],
'category' => '<string>',
'templateSuffix' => '<string>',
'images' => [
[
'src' => 'https://cdn.example.com/widget.jpg',
'altText' => '<string>'
]
],
'medias' => [
[
'file' => '<string>',
'name' => '<string>',
'size' => 1,
'type' => '<string>',
'variant' => '<string>',
'variantId' => '<string>',
'assignedTo' => '<string>'
]
],
'vendor' => '<string>',
'brandName' => '<string>',
'collections' => [
'<string>'
],
'isDigital' => true
]),
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://production-api.puppetvendors.com/products/{productId}"
payload := strings.NewReader("{\n \"title\": \"Widget Pro Deluxe v2\",\n \"descriptionHtml\": \"<string>\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"productType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"handle\": \"<string>\",\n \"options\": [\n {\n \"name\": \"Color\",\n \"values\": [\n \"Red\",\n \"Blue\",\n \"Green\"\n ]\n }\n ],\n \"variants\": [\n {\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"Red\"\n }\n ],\n \"price\": \"29.99\",\n \"compareAtPrice\": \"39.99\",\n \"sku\": \"WIDGET-RED-L\",\n \"barcode\": \"<string>\",\n \"inventoryQuantity\": 100,\n \"locationId\": \"gid://shopify/Location/123456\",\n \"requiresShipping\": true,\n \"taxable\": true,\n \"inventoryPolicy\": \"DENY\"\n }\n ],\n \"metafields\": [\n {\n \"namespace\": \"custom\",\n \"key\": \"color_family\",\n \"value\": \"red\",\n \"type\": \"single_line_text_field\",\n \"description\": \"<string>\"\n }\n ],\n \"seo\": {\n \"title\": \"Premium Widget - Best Price Online\",\n \"description\": \"High-quality widgets at competitive prices. Free shipping on orders over $50.\"\n },\n \"category\": \"<string>\",\n \"templateSuffix\": \"<string>\",\n \"images\": [\n {\n \"src\": \"https://cdn.example.com/widget.jpg\",\n \"altText\": \"<string>\"\n }\n ],\n \"medias\": [\n {\n \"file\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 1,\n \"type\": \"<string>\",\n \"variant\": \"<string>\",\n \"variantId\": \"<string>\",\n \"assignedTo\": \"<string>\"\n }\n ],\n \"vendor\": \"<string>\",\n \"brandName\": \"<string>\",\n \"collections\": [\n \"<string>\"\n ],\n \"isDigital\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://production-api.puppetvendors.com/products/{productId}")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Widget Pro Deluxe v2\",\n \"descriptionHtml\": \"<string>\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"productType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"handle\": \"<string>\",\n \"options\": [\n {\n \"name\": \"Color\",\n \"values\": [\n \"Red\",\n \"Blue\",\n \"Green\"\n ]\n }\n ],\n \"variants\": [\n {\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"Red\"\n }\n ],\n \"price\": \"29.99\",\n \"compareAtPrice\": \"39.99\",\n \"sku\": \"WIDGET-RED-L\",\n \"barcode\": \"<string>\",\n \"inventoryQuantity\": 100,\n \"locationId\": \"gid://shopify/Location/123456\",\n \"requiresShipping\": true,\n \"taxable\": true,\n \"inventoryPolicy\": \"DENY\"\n }\n ],\n \"metafields\": [\n {\n \"namespace\": \"custom\",\n \"key\": \"color_family\",\n \"value\": \"red\",\n \"type\": \"single_line_text_field\",\n \"description\": \"<string>\"\n }\n ],\n \"seo\": {\n \"title\": \"Premium Widget - Best Price Online\",\n \"description\": \"High-quality widgets at competitive prices. Free shipping on orders over $50.\"\n },\n \"category\": \"<string>\",\n \"templateSuffix\": \"<string>\",\n \"images\": [\n {\n \"src\": \"https://cdn.example.com/widget.jpg\",\n \"altText\": \"<string>\"\n }\n ],\n \"medias\": [\n {\n \"file\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 1,\n \"type\": \"<string>\",\n \"variant\": \"<string>\",\n \"variantId\": \"<string>\",\n \"assignedTo\": \"<string>\"\n }\n ],\n \"vendor\": \"<string>\",\n \"brandName\": \"<string>\",\n \"collections\": [\n \"<string>\"\n ],\n \"isDigital\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production-api.puppetvendors.com/products/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Widget Pro Deluxe v2\",\n \"descriptionHtml\": \"<string>\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"productType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"handle\": \"<string>\",\n \"options\": [\n {\n \"name\": \"Color\",\n \"values\": [\n \"Red\",\n \"Blue\",\n \"Green\"\n ]\n }\n ],\n \"variants\": [\n {\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"Red\"\n }\n ],\n \"price\": \"29.99\",\n \"compareAtPrice\": \"39.99\",\n \"sku\": \"WIDGET-RED-L\",\n \"barcode\": \"<string>\",\n \"inventoryQuantity\": 100,\n \"locationId\": \"gid://shopify/Location/123456\",\n \"requiresShipping\": true,\n \"taxable\": true,\n \"inventoryPolicy\": \"DENY\"\n }\n ],\n \"metafields\": [\n {\n \"namespace\": \"custom\",\n \"key\": \"color_family\",\n \"value\": \"red\",\n \"type\": \"single_line_text_field\",\n \"description\": \"<string>\"\n }\n ],\n \"seo\": {\n \"title\": \"Premium Widget - Best Price Online\",\n \"description\": \"High-quality widgets at competitive prices. Free shipping on orders over $50.\"\n },\n \"category\": \"<string>\",\n \"templateSuffix\": \"<string>\",\n \"images\": [\n {\n \"src\": \"https://cdn.example.com/widget.jpg\",\n \"altText\": \"<string>\"\n }\n ],\n \"medias\": [\n {\n \"file\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 1,\n \"type\": \"<string>\",\n \"variant\": \"<string>\",\n \"variantId\": \"<string>\",\n \"assignedTo\": \"<string>\"\n }\n ],\n \"vendor\": \"<string>\",\n \"brandName\": \"<string>\",\n \"collections\": [\n \"<string>\"\n ],\n \"isDigital\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439013",
"title": "Widget Pro",
"handle": "widget-pro",
"status": "active",
"vendorId": "507f1f77bcf86cd799439011",
"variants": [
{
"_id": "<string>",
"id": "<string>",
"admin_graphql_api_id": "<string>",
"title": "<string>",
"sku": "<string>",
"price": 123,
"inventory": 123,
"optionValues": [
{
"name": "<string>",
"value": "<string>"
}
],
"selectedOptions": [
{
"name": "<string>",
"value": "<string>"
}
],
"inventoryQuantities": [
{
"locationId": "<string>",
"name": "<string>",
"quantity": 123,
"availableQuantity": 123
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}Update a product
Update any product in your store, straight to Shopify. Send vendorId to move the product to another vendor. Send the full set of metafields: any left out are deleted. A live product with a vendor edit waiting for review is refused with 409 PRODUCT_PENDING_REVIEW; approve or reject the edit first. Requires the admin:products:write permission.
curl --request PUT \
--url https://production-api.puppetvendors.com/products/{productId} \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"title": "Widget Pro Deluxe v2",
"descriptionHtml": "<string>",
"vendorId": "507f1f77bcf86cd799439011",
"productType": "<string>",
"tags": [
"<string>"
],
"handle": "<string>",
"options": [
{
"name": "Color",
"values": [
"Red",
"Blue",
"Green"
]
}
],
"variants": [
{
"optionValues": [
{
"name": "Color",
"value": "Red"
}
],
"price": "29.99",
"compareAtPrice": "39.99",
"sku": "WIDGET-RED-L",
"barcode": "<string>",
"inventoryQuantity": 100,
"locationId": "gid://shopify/Location/123456",
"requiresShipping": true,
"taxable": true,
"inventoryPolicy": "DENY"
}
],
"metafields": [
{
"namespace": "custom",
"key": "color_family",
"value": "red",
"type": "single_line_text_field",
"description": "<string>"
}
],
"seo": {
"title": "Premium Widget - Best Price Online",
"description": "High-quality widgets at competitive prices. Free shipping on orders over $50."
},
"category": "<string>",
"templateSuffix": "<string>",
"images": [
{
"src": "https://cdn.example.com/widget.jpg",
"altText": "<string>"
}
],
"medias": [
{
"file": "<string>",
"name": "<string>",
"size": 1,
"type": "<string>",
"variant": "<string>",
"variantId": "<string>",
"assignedTo": "<string>"
}
],
"vendor": "<string>",
"brandName": "<string>",
"collections": [
"<string>"
],
"isDigital": true
}
'import requests
url = "https://production-api.puppetvendors.com/products/{productId}"
payload = {
"title": "Widget Pro Deluxe v2",
"descriptionHtml": "<string>",
"vendorId": "507f1f77bcf86cd799439011",
"productType": "<string>",
"tags": ["<string>"],
"handle": "<string>",
"options": [
{
"name": "Color",
"values": ["Red", "Blue", "Green"]
}
],
"variants": [
{
"optionValues": [
{
"name": "Color",
"value": "Red"
}
],
"price": "29.99",
"compareAtPrice": "39.99",
"sku": "WIDGET-RED-L",
"barcode": "<string>",
"inventoryQuantity": 100,
"locationId": "gid://shopify/Location/123456",
"requiresShipping": True,
"taxable": True,
"inventoryPolicy": "DENY"
}
],
"metafields": [
{
"namespace": "custom",
"key": "color_family",
"value": "red",
"type": "single_line_text_field",
"description": "<string>"
}
],
"seo": {
"title": "Premium Widget - Best Price Online",
"description": "High-quality widgets at competitive prices. Free shipping on orders over $50."
},
"category": "<string>",
"templateSuffix": "<string>",
"images": [
{
"src": "https://cdn.example.com/widget.jpg",
"altText": "<string>"
}
],
"medias": [
{
"file": "<string>",
"name": "<string>",
"size": 1,
"type": "<string>",
"variant": "<string>",
"variantId": "<string>",
"assignedTo": "<string>"
}
],
"vendor": "<string>",
"brandName": "<string>",
"collections": ["<string>"],
"isDigital": True
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Widget Pro Deluxe v2',
descriptionHtml: '<string>',
vendorId: '507f1f77bcf86cd799439011',
productType: '<string>',
tags: ['<string>'],
handle: '<string>',
options: [{name: 'Color', values: ['Red', 'Blue', 'Green']}],
variants: [
{
optionValues: [{name: 'Color', value: 'Red'}],
price: '29.99',
compareAtPrice: '39.99',
sku: 'WIDGET-RED-L',
barcode: '<string>',
inventoryQuantity: 100,
locationId: 'gid://shopify/Location/123456',
requiresShipping: true,
taxable: true,
inventoryPolicy: 'DENY'
}
],
metafields: [
{
namespace: 'custom',
key: 'color_family',
value: 'red',
type: 'single_line_text_field',
description: '<string>'
}
],
seo: {
title: 'Premium Widget - Best Price Online',
description: 'High-quality widgets at competitive prices. Free shipping on orders over $50.'
},
category: '<string>',
templateSuffix: '<string>',
images: [{src: 'https://cdn.example.com/widget.jpg', altText: '<string>'}],
medias: [
{
file: '<string>',
name: '<string>',
size: 1,
type: '<string>',
variant: '<string>',
variantId: '<string>',
assignedTo: '<string>'
}
],
vendor: '<string>',
brandName: '<string>',
collections: ['<string>'],
isDigital: true
})
};
fetch('https://production-api.puppetvendors.com/products/{productId}', 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://production-api.puppetvendors.com/products/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Widget Pro Deluxe v2',
'descriptionHtml' => '<string>',
'vendorId' => '507f1f77bcf86cd799439011',
'productType' => '<string>',
'tags' => [
'<string>'
],
'handle' => '<string>',
'options' => [
[
'name' => 'Color',
'values' => [
'Red',
'Blue',
'Green'
]
]
],
'variants' => [
[
'optionValues' => [
[
'name' => 'Color',
'value' => 'Red'
]
],
'price' => '29.99',
'compareAtPrice' => '39.99',
'sku' => 'WIDGET-RED-L',
'barcode' => '<string>',
'inventoryQuantity' => 100,
'locationId' => 'gid://shopify/Location/123456',
'requiresShipping' => true,
'taxable' => true,
'inventoryPolicy' => 'DENY'
]
],
'metafields' => [
[
'namespace' => 'custom',
'key' => 'color_family',
'value' => 'red',
'type' => 'single_line_text_field',
'description' => '<string>'
]
],
'seo' => [
'title' => 'Premium Widget - Best Price Online',
'description' => 'High-quality widgets at competitive prices. Free shipping on orders over $50.'
],
'category' => '<string>',
'templateSuffix' => '<string>',
'images' => [
[
'src' => 'https://cdn.example.com/widget.jpg',
'altText' => '<string>'
]
],
'medias' => [
[
'file' => '<string>',
'name' => '<string>',
'size' => 1,
'type' => '<string>',
'variant' => '<string>',
'variantId' => '<string>',
'assignedTo' => '<string>'
]
],
'vendor' => '<string>',
'brandName' => '<string>',
'collections' => [
'<string>'
],
'isDigital' => true
]),
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://production-api.puppetvendors.com/products/{productId}"
payload := strings.NewReader("{\n \"title\": \"Widget Pro Deluxe v2\",\n \"descriptionHtml\": \"<string>\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"productType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"handle\": \"<string>\",\n \"options\": [\n {\n \"name\": \"Color\",\n \"values\": [\n \"Red\",\n \"Blue\",\n \"Green\"\n ]\n }\n ],\n \"variants\": [\n {\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"Red\"\n }\n ],\n \"price\": \"29.99\",\n \"compareAtPrice\": \"39.99\",\n \"sku\": \"WIDGET-RED-L\",\n \"barcode\": \"<string>\",\n \"inventoryQuantity\": 100,\n \"locationId\": \"gid://shopify/Location/123456\",\n \"requiresShipping\": true,\n \"taxable\": true,\n \"inventoryPolicy\": \"DENY\"\n }\n ],\n \"metafields\": [\n {\n \"namespace\": \"custom\",\n \"key\": \"color_family\",\n \"value\": \"red\",\n \"type\": \"single_line_text_field\",\n \"description\": \"<string>\"\n }\n ],\n \"seo\": {\n \"title\": \"Premium Widget - Best Price Online\",\n \"description\": \"High-quality widgets at competitive prices. Free shipping on orders over $50.\"\n },\n \"category\": \"<string>\",\n \"templateSuffix\": \"<string>\",\n \"images\": [\n {\n \"src\": \"https://cdn.example.com/widget.jpg\",\n \"altText\": \"<string>\"\n }\n ],\n \"medias\": [\n {\n \"file\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 1,\n \"type\": \"<string>\",\n \"variant\": \"<string>\",\n \"variantId\": \"<string>\",\n \"assignedTo\": \"<string>\"\n }\n ],\n \"vendor\": \"<string>\",\n \"brandName\": \"<string>\",\n \"collections\": [\n \"<string>\"\n ],\n \"isDigital\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://production-api.puppetvendors.com/products/{productId}")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Widget Pro Deluxe v2\",\n \"descriptionHtml\": \"<string>\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"productType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"handle\": \"<string>\",\n \"options\": [\n {\n \"name\": \"Color\",\n \"values\": [\n \"Red\",\n \"Blue\",\n \"Green\"\n ]\n }\n ],\n \"variants\": [\n {\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"Red\"\n }\n ],\n \"price\": \"29.99\",\n \"compareAtPrice\": \"39.99\",\n \"sku\": \"WIDGET-RED-L\",\n \"barcode\": \"<string>\",\n \"inventoryQuantity\": 100,\n \"locationId\": \"gid://shopify/Location/123456\",\n \"requiresShipping\": true,\n \"taxable\": true,\n \"inventoryPolicy\": \"DENY\"\n }\n ],\n \"metafields\": [\n {\n \"namespace\": \"custom\",\n \"key\": \"color_family\",\n \"value\": \"red\",\n \"type\": \"single_line_text_field\",\n \"description\": \"<string>\"\n }\n ],\n \"seo\": {\n \"title\": \"Premium Widget - Best Price Online\",\n \"description\": \"High-quality widgets at competitive prices. Free shipping on orders over $50.\"\n },\n \"category\": \"<string>\",\n \"templateSuffix\": \"<string>\",\n \"images\": [\n {\n \"src\": \"https://cdn.example.com/widget.jpg\",\n \"altText\": \"<string>\"\n }\n ],\n \"medias\": [\n {\n \"file\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 1,\n \"type\": \"<string>\",\n \"variant\": \"<string>\",\n \"variantId\": \"<string>\",\n \"assignedTo\": \"<string>\"\n }\n ],\n \"vendor\": \"<string>\",\n \"brandName\": \"<string>\",\n \"collections\": [\n \"<string>\"\n ],\n \"isDigital\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production-api.puppetvendors.com/products/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Widget Pro Deluxe v2\",\n \"descriptionHtml\": \"<string>\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"productType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"handle\": \"<string>\",\n \"options\": [\n {\n \"name\": \"Color\",\n \"values\": [\n \"Red\",\n \"Blue\",\n \"Green\"\n ]\n }\n ],\n \"variants\": [\n {\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"Red\"\n }\n ],\n \"price\": \"29.99\",\n \"compareAtPrice\": \"39.99\",\n \"sku\": \"WIDGET-RED-L\",\n \"barcode\": \"<string>\",\n \"inventoryQuantity\": 100,\n \"locationId\": \"gid://shopify/Location/123456\",\n \"requiresShipping\": true,\n \"taxable\": true,\n \"inventoryPolicy\": \"DENY\"\n }\n ],\n \"metafields\": [\n {\n \"namespace\": \"custom\",\n \"key\": \"color_family\",\n \"value\": \"red\",\n \"type\": \"single_line_text_field\",\n \"description\": \"<string>\"\n }\n ],\n \"seo\": {\n \"title\": \"Premium Widget - Best Price Online\",\n \"description\": \"High-quality widgets at competitive prices. Free shipping on orders over $50.\"\n },\n \"category\": \"<string>\",\n \"templateSuffix\": \"<string>\",\n \"images\": [\n {\n \"src\": \"https://cdn.example.com/widget.jpg\",\n \"altText\": \"<string>\"\n }\n ],\n \"medias\": [\n {\n \"file\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 1,\n \"type\": \"<string>\",\n \"variant\": \"<string>\",\n \"variantId\": \"<string>\",\n \"assignedTo\": \"<string>\"\n }\n ],\n \"vendor\": \"<string>\",\n \"brandName\": \"<string>\",\n \"collections\": [\n \"<string>\"\n ],\n \"isDigital\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439013",
"title": "Widget Pro",
"handle": "widget-pro",
"status": "active",
"vendorId": "507f1f77bcf86cd799439011",
"variants": [
{
"_id": "<string>",
"id": "<string>",
"admin_graphql_api_id": "<string>",
"title": "<string>",
"sku": "<string>",
"price": 123,
"inventory": 123,
"optionValues": [
{
"name": "<string>",
"value": "<string>"
}
],
"selectedOptions": [
{
"name": "<string>",
"value": "<string>"
}
],
"inventoryQuantities": [
{
"locationId": "<string>",
"name": "<string>",
"quantity": 123,
"availableQuantity": 123
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"errorId": "err_1783365360839_j281w7b",
"details": {}
}
}Authorizations
JWT minted from a merchant API key (mk_live_…) by POST /authenticate. Send the token value directly, with no "Bearer" prefix. Tokens last 14 days and can be renewed at POST /refresh-token; revoking the key refuses the next request made with any token minted from it.
Path Parameters
A product ObjectId, a Shopify product GID or a numeric Shopify product id. Malformed is 400.
Body
Product title
1 - 255"Widget Pro Deluxe v2"
HTML description. Send an empty string to clear it; omit it to keep the current value.
Move the product to this vendor. Must be a vendor of your shop (403 otherwise); a malformed id is 400.
"507f1f77bcf86cd799439011"
Product type/category
255Product tags (replaces existing)
250255Product status
ACTIVE, DRAFT, ARCHIVED URL-friendly product handle
255Product options (replaces existing)
3Show child attributes
Show child attributes
Product variants (replaces existing)
100Show child attributes
Show child attributes
Custom metafields (replaces existing)
Show child attributes
Show child attributes
SEO settings
Show child attributes
Show child attributes
Product category/collection
Custom template suffix
Product images (replaces existing on update)
250Show child attributes
Show child attributes
Digital files for download after purchase. On update, omit to keep existing files.
250Show child attributes
Show child attributes
Vendor display name on the Shopify product
Brand name
Shopify collection ids. The list replaces the product's collections: any collection not in it is removed. Omit the field to keep the current collections, or send [] to remove the product from all of them.
2501Marks the product as a digital product (use with medias)
Was this page helpful?