Attaching fulfillment service to default product variant after product creation

Hey, We can’t attach a fulfillment service to the default variant when creating a new product. In the latest API version, updating the fulfillment service for a product variant isn’t supported. As a workaround, we’ve been using an older version of the GraphQL API that still allows fulfillment service updates. However, since that older API version is being deprecated, we need to find another solution going forward.

Hi Kaustubh,

Can you share the mutation that works with older versions, and which doesn’t work with the latest version?

Hi Liam,

Sure, here is the mutation that works with older versions but isn’t supported in latest versions:
Although, there is mutation called productvariantbulkupdate but we need to add/update the fulfillment service to the product variant and that property is not in the latest version of ProductVariantsBulkInput!

mutation productVariantUpdate($input: ProductVariantInput!) {
productVariantUpdate(input: $input) {
productVariant {
id
fulfillmentService {
id
}
inventoryItem {
id
tracked
}
}
userErrors {
field
message
}
}
}
Thanks,
Kaustubh Khairnar
Software Developer
Email: kaustubh@chiefss.com

[//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/shopifycommunity/original/2X/e/e5b6cb3ee0ac0168b88a25c023ed18612206c57d.png]

Could you use the inventorySetQuantities mutation for this?

This allows you to set inventory quantities for the product variant at the location managed by the fulfillment service, and when an order is placed, Shopify will automatically assign the fulfillment order to the appropriate location based on inventory availability and the fulfillment service configuration.

Hey, Liam inventoryQuantities field only allows updates in productVariantBulkCreate mutation

Hey Liam,
I’ve implemented a temporary fix where I first create the product, then add the necessary variants, and finally delete and recreate the default variant. This approach lets me assign the required fulfillment service to the default variant.

While this might not be ideal for everyone, it serves as a workable solution for now—at least until Shopify provides a more optimized and official fix for this issue.

Thanks for your support!

Hi Kaustubh - that does appear to be the best approach for now.

1 Like

@Kaustubh_Khairnar I am also facing the same issue. Can you tell me which mutation you are using to assign the fulfillmentService to a variant?

fulfillmentService is no longer supported in ProductVariantInput, hence I am unable to assign it when creating the variant.

hey joycebabu, I am not really attaching the fulfillment service to product variant but instead I am deleting the product variant using productVariantsBulkDelete mutation and recreating the product variant with same configuration using productVariantsBulkCreate mutation here you can assign the location id of the fulfillment service under inventoryQuantities which will assign the fulfillment service to the variant.