create sku for variant on variant creation

Anonymous Anonymous query
0

To create an SKU for a variant on variant creation, you can use the Product variant added trigger in Shopify Flow, as mentioned in the triggers.json document.

When a new variant is added, you can use the Update product variant action, as described in the actions.json document, to generate and assign a unique SKU to the variant.

Additionally, you can utilize the productVariantUpdate mutation from the send-admin-api-mutations.json document to update the variant with the newly generated SKU.

Please refer to the following documents for more information:

Note that the available documents do not provide a direct example of how to generate an SKU. However, you can use the Product variant added trigger and the Update product variant action to achieve this functionality.