farid
October 3, 2025, 8:08am
1
I am trying to utilize the Admin intents feature to enable users to edit variants without needing to leave our app.
This is the code to trigger the modal.
console.log('variant_id', variant_id);
const activity = await shopify.intents.invoke('edit:shopify/ProductVariant', {
value: 'gid://shopify/ProductVariant/' + variant_id,
});
This is the variant I am trying to edit.
This is my console log.
Am I missing something here?
farid
October 3, 2025, 8:10am
2
@Liam-Shopify @Daniel_Ablestar Hey guys, am I missing something here? Any ideas why this wouldn’t work?
After playing around with it some I was able to get it to work with the following code:
const activity = await shopify.intents.invoke(
"edit:shopify/ProductVariant",
{
value: "gid://shopify/ProductVariant/58178392162385",
data: {
productId: "15534429962321",
},
}
);
const response = await activity.complete;
console.log(response);
The productId isn’t mentioned in the documentation but looking at the console.log(response); output it looked like it was required.
Also, for this intent and for the create variant intent , the productId needs to be the numeric ID of the product, cast as a string. The documentation currently says you need the full gid for the productId.
farid
October 3, 2025, 9:16am
4
Thanks @Daniel_Ablestar this works!
farid
October 3, 2025, 9:21am
5
@Liam-Shopify Danel’s solution solves the problem, but the documentation is not correct and still needs to be fixed.