Created
February 21, 2023 10:09
-
-
Save apurbajnu/44c7e46b53dab6df99364f20f0bae549 to your computer and use it in GitHub Desktop.
Shopify Product Import Graphql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mutation { | |
| productCreate(input: { | |
| title: "Demo Product", | |
| descriptionHtml: "This is a demo product description.", | |
| productType: "Demo Product Type", | |
| vendor: "Demo Vendor", | |
| handle: "demo-product", | |
| published: true, | |
| options: [ | |
| { name: "Size", values: ["Small", "Medium", "Large"] }, | |
| { name: "Color", values: ["Red", "Green", "Blue"] } | |
| ], | |
| variants: [ | |
| { | |
| price: "19.99", | |
| sku: "demo-product-small-red", | |
| barcode: "1234567890", | |
| inventoryQuantities: [ | |
| { locationId: "gid://shopify/Location/1234567890", availableQuantity: 10 } | |
| ], | |
| options: [ | |
| { name: "Size", value: "Small" }, | |
| { name: "Color", value: "Red" } | |
| ] | |
| }, | |
| { | |
| price: "21.99", | |
| sku: "demo-product-medium-green", | |
| barcode: "0987654321", | |
| inventoryQuantities: [ | |
| { locationId: "gid://shopify/Location/1234567890", availableQuantity: 5 } | |
| ], | |
| options: [ | |
| { name: "Size", value: "Medium" }, | |
| { name: "Color", value: "Green" } | |
| ] | |
| }, | |
| { | |
| price: "24.99", | |
| sku: "demo-product-large-blue", | |
| barcode: "2345678901", | |
| inventoryQuantities: [ | |
| { locationId: "gid://shopify/Location/1234567890", availableQuantity: 3 } | |
| ], | |
| options: [ | |
| { name: "Size", value: "Large" }, | |
| { name: "Color", value: "Blue" } | |
| ] | |
| } | |
| ], | |
| images: [ | |
| { src: "https://example.com/demo-product-image-1.jpg" }, | |
| { src: "https://example.com/demo-product-image-2.jpg" } | |
| ] | |
| }) { | |
| product { | |
| id | |
| } | |
| userErrors { | |
| field | |
| message | |
| } | |
| } | |
| } |
Author
Author
mutation productUpdate($input: ProductInput!) {
productUpdate(input: $input) {
product {
# Product fields
}
userErrors {
field
message
}
}
}
mutation productCreate($input: ProductInput!) {
productCreate(input: $input) {
product {
# Product fields
}
shop {
# Shop fields
}
userErrors {
field
message
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{
"input": {
"id": "gid://shopify/Product/6962531303503",
"descriptionHtml": "
This is a demo product description.
","title": "Single Button Longerline Tailored Apricot Causal Blazer",
"handle": "Single-Button-Longerline-Tailored-Apricot-Causal-Blazer",
"giftCard": false,
"handle": "Single-Button-Longerline-Tailored-Apricot-Causal-Blazer",
"productCategory": {
"productTaxonomyNodeId": "gid://shopify/ProductTaxonomyNode/126"
},
"metafields": [
{
"description": "Defination",
"key": "sound",
"namespace": "prop",
"type": "single_line_text_field",
"value": "dishu dishu"
}
],
"productType": "Blazers",
"options": [
"size"
],
"variants": [
{
"options": ["S"],
"inventoryItem": {
"cost": "40.63",
"tracked": true
},
"inventoryPolicy": "DENY",
"inventoryQuantities": [
{
"availableQuantity": 10,
"locationId": "gid://shopify/Location/32796573775"
}
],
"price": "99.00",
"sku": "CT1003-Z20-13",
"taxable": true,
"weight": 1.1,
"weightUnit": "KILOGRAMS"
},
{
"options": ["M"],
"inventoryItem": {
"cost": "40.63",
"tracked": true
},
"inventoryPolicy": "DENY",
"inventoryQuantities": [
{
"availableQuantity": 50,
"locationId": "gid://shopify/Location/32796573775"
}
],
"price": "99.00",
"sku": "CT1003-Z20-14",
"taxable": true,
"weight": 1.1,
"weightUnit": "KILOGRAMS"
},
{
"options": ["L"],
"inventoryItem": {
"cost": "40.63",
"tracked": true
},
"inventoryPolicy": "DENY",
"inventoryQuantities": [
{
"availableQuantity": 50,
"locationId": "gid://shopify/Location/32796573775"
}
],
"price": "99.00",
"sku": "CT1003-Z20-15",
"taxable": true,
"weight": 1.1,
"weightUnit": "KILOGRAMS"
},
{
"options": ["XL"],
"inventoryItem": {
"cost": "40.63",
"tracked": true
},
"inventoryPolicy": "DENY",
"inventoryQuantities": [
{
"availableQuantity": 50,
"locationId": "gid://shopify/Location/32796573775"
}
],
"price": "99.00",
"sku": "CT1003-Z20-14",
"taxable": true,
"weight": 1.1,
"weightUnit": "KILOGRAMS"
}
}
}