How to mark product as digital using graphql?

We’re using the productSet mutation for creating and updating products. However, we’re unsure how to mark a product as digital. In the REST API, we achieved this by setting "requires_shipping": false at the variant level.

We found this question and seems like productSet does not support this yet, so what should we do in the meanwhile?

Does anyone know how to accomplish this using GraphQL?

I was about to say that you should look at the ProductVariant mutations, but it seems to be deprecated since the latest API version. I could not find an alternative, and the dev assistant AI was not aware of any solution either.

Interesting to see from the team :eyes:

1 Like

Please use the requiresShipping field in the InventoryItem object.

1 Like

Does that actually fully convert the variant to a digital item?

Yes, If you sell a digital download product or a service, then you need to remove shipping for that product.

mutation inventoryItemUpdate($id: ID!, $input: InventoryItemInput!) {
  inventoryItemUpdate(id: $id, input: $input) {
    inventoryItem {
      id
      tracked
      requiresShipping
    }
    userErrors {
      message
    }
  }
}
{
  "id": "gid://shopify/InventoryItem/123456789",
  "input": {
    "tracked": true,
    "requiresShipping": false
  }
}

2 Likes

Makes sense, as this was also how it was handled before, just not in the Inventory resource. Just wanted to make sure. Tried to ask the dev assistant which alleged that it also required some tax settings now :smiley:

AMaL gave you the right solution, if you wanna mark it

Thanks for confirming! I’m glad the solution made sense. Feel free to mark the solution as accepted if it resolved your query. :grinning:

1 Like

thanks for the great answers @AMaL @curzey
it means that my app needs to have also inventory_read & inventory_write permissions then?
Thanks again for your quick answers, could not find this information anywhere

1 Like