App reviews, troubleshooting, and recommendations
Hello,
I am building an application that synchronizes products between our application and Shopify. My goal is to create multiple products, each with a Title, Price, and SKU with one request. From what I understand, the SKU and Price can only be assigned to product variants. If I do not create any variants, Shopify uses a "default variant," correct?
While importing new products into Shopify, I am trying to be as request-efficient as possible by using the mutations/productSet. However, I am encountering an issue where I am unable to assign the Price and SKU to the "default variant." Is there a workaround for this, or am I approaching it incorrectly? Additionally, I would like to handle this in one mutation to keep our application logic simple and easily extendable in the future.
// here optionValues field is required for variants
PRODUCT_CREATE_INPUT = '{"input":{"title":"%s","variants":[{"sku":"%s","price":"%s"}]}, "synchronous": false}';
CREATE_MUTATION = 'mutation {
bulkOperationRunMutation(
mutation: "mutation call($input: ProductSetInput!, $synchronous: Boolean!) { productSet(synchronous: $synchronous, input: $input) { product {title productType vendor} productSetOperation {id userErrors{code field message}} userErrors { message field } } }",
stagedUploadPath: "%s"
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}';
Thank you for your answers!
Bc. Martin Pech
EDIT: Found this solution, which works for me, but feels a little bit goofy. Better solutions are still appreciated.
https://community.shopify.com/c/graphql-basics-and/create-products-without-variant-options-using-pro...
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024