curl --request POST \
--url https://production-api.puppetvendors.com/products \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"title": "Widget Pro Deluxe",
"vendorId": "507f1f77bcf86cd799439011",
"descriptionHtml": "<p>Premium widget with advanced features</p>",
"productType": "Widgets",
"tags": [
"premium",
"bestseller",
"new"
],
"status": "DRAFT",
"handle": "widget-pro-deluxe",
"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": "Electronics",
"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"
payload = {
"title": "Widget Pro Deluxe",
"vendorId": "507f1f77bcf86cd799439011",
"descriptionHtml": "<p>Premium widget with advanced features</p>",
"productType": "Widgets",
"tags": ["premium", "bestseller", "new"],
"status": "DRAFT",
"handle": "widget-pro-deluxe",
"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": "Electronics",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Widget Pro Deluxe',
vendorId: '507f1f77bcf86cd799439011',
descriptionHtml: '<p>Premium widget with advanced features</p>',
productType: 'Widgets',
tags: ['premium', 'bestseller', 'new'],
status: 'DRAFT',
handle: 'widget-pro-deluxe',
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: 'Electronics',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Widget Pro Deluxe',
'vendorId' => '507f1f77bcf86cd799439011',
'descriptionHtml' => '<p>Premium widget with advanced features</p>',
'productType' => 'Widgets',
'tags' => [
'premium',
'bestseller',
'new'
],
'status' => 'DRAFT',
'handle' => 'widget-pro-deluxe',
'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' => 'Electronics',
'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"
payload := strings.NewReader("{\n \"title\": \"Widget Pro Deluxe\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"descriptionHtml\": \"<p>Premium widget with advanced features</p>\",\n \"productType\": \"Widgets\",\n \"tags\": [\n \"premium\",\n \"bestseller\",\n \"new\"\n ],\n \"status\": \"DRAFT\",\n \"handle\": \"widget-pro-deluxe\",\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\": \"Electronics\",\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("POST", 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.post("https://production-api.puppetvendors.com/products")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Widget Pro Deluxe\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"descriptionHtml\": \"<p>Premium widget with advanced features</p>\",\n \"productType\": \"Widgets\",\n \"tags\": [\n \"premium\",\n \"bestseller\",\n \"new\"\n ],\n \"status\": \"DRAFT\",\n \"handle\": \"widget-pro-deluxe\",\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\": \"Electronics\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Widget Pro Deluxe\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"descriptionHtml\": \"<p>Premium widget with advanced features</p>\",\n \"productType\": \"Widgets\",\n \"tags\": [\n \"premium\",\n \"bestseller\",\n \"new\"\n ],\n \"status\": \"DRAFT\",\n \"handle\": \"widget-pro-deluxe\",\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\": \"Electronics\",\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": {}
}
}Create a product
Create a product for the vendor in vendorId. It goes straight to Shopify without product approval, and vendor-side restrictions don’t apply; title, price and metafield rules still do. Send the full set of metafields: any left out are deleted. Requires the admin:products:write permission.
curl --request POST \
--url https://production-api.puppetvendors.com/products \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"title": "Widget Pro Deluxe",
"vendorId": "507f1f77bcf86cd799439011",
"descriptionHtml": "<p>Premium widget with advanced features</p>",
"productType": "Widgets",
"tags": [
"premium",
"bestseller",
"new"
],
"status": "DRAFT",
"handle": "widget-pro-deluxe",
"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": "Electronics",
"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"
payload = {
"title": "Widget Pro Deluxe",
"vendorId": "507f1f77bcf86cd799439011",
"descriptionHtml": "<p>Premium widget with advanced features</p>",
"productType": "Widgets",
"tags": ["premium", "bestseller", "new"],
"status": "DRAFT",
"handle": "widget-pro-deluxe",
"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": "Electronics",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Widget Pro Deluxe',
vendorId: '507f1f77bcf86cd799439011',
descriptionHtml: '<p>Premium widget with advanced features</p>',
productType: 'Widgets',
tags: ['premium', 'bestseller', 'new'],
status: 'DRAFT',
handle: 'widget-pro-deluxe',
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: 'Electronics',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Widget Pro Deluxe',
'vendorId' => '507f1f77bcf86cd799439011',
'descriptionHtml' => '<p>Premium widget with advanced features</p>',
'productType' => 'Widgets',
'tags' => [
'premium',
'bestseller',
'new'
],
'status' => 'DRAFT',
'handle' => 'widget-pro-deluxe',
'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' => 'Electronics',
'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"
payload := strings.NewReader("{\n \"title\": \"Widget Pro Deluxe\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"descriptionHtml\": \"<p>Premium widget with advanced features</p>\",\n \"productType\": \"Widgets\",\n \"tags\": [\n \"premium\",\n \"bestseller\",\n \"new\"\n ],\n \"status\": \"DRAFT\",\n \"handle\": \"widget-pro-deluxe\",\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\": \"Electronics\",\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("POST", 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.post("https://production-api.puppetvendors.com/products")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Widget Pro Deluxe\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"descriptionHtml\": \"<p>Premium widget with advanced features</p>\",\n \"productType\": \"Widgets\",\n \"tags\": [\n \"premium\",\n \"bestseller\",\n \"new\"\n ],\n \"status\": \"DRAFT\",\n \"handle\": \"widget-pro-deluxe\",\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\": \"Electronics\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Widget Pro Deluxe\",\n \"vendorId\": \"507f1f77bcf86cd799439011\",\n \"descriptionHtml\": \"<p>Premium widget with advanced features</p>\",\n \"productType\": \"Widgets\",\n \"tags\": [\n \"premium\",\n \"bestseller\",\n \"new\"\n ],\n \"status\": \"DRAFT\",\n \"handle\": \"widget-pro-deluxe\",\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\": \"Electronics\",\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": {}
}
}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.
Body
Product title
1 - 255"Widget Pro Deluxe"
Vendor ObjectId
"507f1f77bcf86cd799439011"
Product description in HTML
"<p>Premium widget with advanced features</p>"
Product type/category
255"Widgets"
Product tags
250255["premium", "bestseller", "new"]
Product status
ACTIVE, DRAFT, ARCHIVED "DRAFT"
URL-friendly product handle
255"widget-pro-deluxe"
Product options (e.g., Color, Size)
3Show child attributes
Show child attributes
Product variants
100Show child attributes
Show child attributes
Custom metafields
Show child attributes
Show child attributes
SEO settings
Show child attributes
Show child attributes
Product category/collection
"Electronics"
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 to add the new product to.
2501Marks the product as a digital product (use with medias)
Was this page helpful?