Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Can we export only Price and Inventory of all the SKUs from Shopify through API???
If yes please share the API call details or link for the same.
Solved! Go to the solution
This is an accepted solution.
hi @HalmenCS
you will definitely need the graphql API in order to do this, using the mutation "bulkOperationRunQuery"
the query to bulk-run is this
{
productVariants{
edges{
node{
id
sku
price
inventoryQuantity
}
}
}
}
to be passed as argument of the mutation so this way:
mutation {
bulkOperationRunQuery(query: """{
productVariants{
edges{
node{
id
sku
price
inventoryQuantity
}
}
}
}""") {
userErrors{
field
message
}
bulkOperation{
id
status
url
}
}
}
after launching this mutation you will need to poll the bulk operations endpoint to get the status of the mutation launched: when completed, you'll receive a link for your JSONL file with all the data required, you can parse it the way you want, with a script or, since this query has only 1 node in output and so you will have only 1 line for each product, you could also easily convert the JSONL into a text/csv by doing some replaceAll with a text editor
This is an accepted solution.
hi @HalmenCS
you will definitely need the graphql API in order to do this, using the mutation "bulkOperationRunQuery"
the query to bulk-run is this
{
productVariants{
edges{
node{
id
sku
price
inventoryQuantity
}
}
}
}
to be passed as argument of the mutation so this way:
mutation {
bulkOperationRunQuery(query: """{
productVariants{
edges{
node{
id
sku
price
inventoryQuantity
}
}
}
}""") {
userErrors{
field
message
}
bulkOperation{
id
status
url
}
}
}
after launching this mutation you will need to poll the bulk operations endpoint to get the status of the mutation launched: when completed, you'll receive a link for your JSONL file with all the data required, you can parse it the way you want, with a script or, since this query has only 1 node in output and so you will have only 1 line for each product, you could also easily convert the JSONL into a text/csv by doing some replaceAll with a text editor