Loading...
Loading...
Create and manage Shopify products via the Admin API. Workflow: gather product data, choose method (API or CSV), execute, verify. Use when adding products, bulk importing, updating variants, managing inventory, uploading product images, or assigning products to collections.
npx skill4agent add jezweb/claude-skills shopify-productsshopify.config.json.dev.vars| Scenario | Method |
|---|---|
| 1-5 products | GraphQL mutations |
| 6-20 products | GraphQL with batching |
| 20+ products | CSV import via admin |
| Updates to existing | GraphQL mutations |
| Inventory adjustments | |
curl -s https://{store}/admin/api/2025-01/graphql.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{
"query": "mutation productCreate($product: ProductCreateInput!) { productCreate(product: $product) { product { id title } userErrors { field message } } }",
"variables": {
"product": {
"title": "Example T-Shirt",
"descriptionHtml": "<p>Premium cotton tee</p>",
"vendor": "My Brand",
"productType": "T-Shirts",
"tags": ["summer", "cotton"],
"options": ["Size", "Colour"],
"variants": [
{"optionValues": [{"optionName": "Size", "name": "S"}, {"optionName": "Colour", "name": "Black"}], "price": "29.95"},
{"optionValues": [{"optionName": "Size", "name": "M"}, {"optionName": "Colour", "name": "Black"}], "price": "29.95"},
{"optionValues": [{"optionName": "Size", "name": "L"}, {"optionName": "Colour", "name": "Black"}], "price": "29.95"}
]
}
}
}'references/graphql-mutations.mdreferences/csv-format.mdassets/product-csv-template.csvhttps://{store}.myshopify.com/admin/products/importmutation {
stagedUploadsCreate(input: [{
filename: "product-image.jpg"
mimeType: "image/jpeg"
httpMethod: POST
resource: IMAGE
}]) {
stagedTargets {
url
resourceUrl
parameters { name value }
}
}
}productCreateMediasrc{
"images": [
{ "src": "https://example.com/image.jpg", "alt": "Product front view" }
]
}mutation {
collectionAddProducts(
id: "gid://shopify/Collection/123456"
productIds: ["gid://shopify/Product/789"]
) {
collection { title productsCount }
userErrors { field message }
}
}{
collections(first: 50) {
edges {
node { id title handle }
}
}
}{
products(first: 10, reverse: true) {
edges {
node {
id title status
variants(first: 5) { edges { node { title price inventoryQuantity } } }
images(first: 3) { edges { node { url altText } } }
}
}
}
}https://{store}.myshopify.com/admin/productsDRAFT{ "status": "ACTIVE" }ACTIVEinventorySetQuantitiesmutation {
inventorySetQuantities(input: {
reason: "correction"
name: "available"
quantities: [{
inventoryItemId: "gid://shopify/InventoryItem/123"
locationId: "gid://shopify/Location/456"
quantity: 50
}]
}) {
inventoryAdjustmentGroup { reason }
userErrors { field message }
}
}"price": "29.95""price": 29.95<p><strong><em><ul><ol><li><h2><h6><a href="..."><img>mutation {
bulkOperationRunMutation(
mutation: "mutation ($input: ProductInput!) { productCreate(input: $input) { product { id } userErrors { message } } }"
stagedUploadPath: "tmp/bulk-products.jsonl"
) {
bulkOperation { id status }
userErrors { message }
}
}assets/product-csv-template.csvreferences/graphql-mutations.mdreferences/csv-format.md