Solved

Fulfillment services, inventory items, and digital products

taylor-single
Shopify Partner
21 2 30

Shopify recommends not using `fulfillment_service` on product variant to associate a fulfillment service with a product variant:


A ProductVariant can be stocked by multiple fulfillment services. As a result, we recommend that you no longer use the following fields:
- ProductVariant.fulfillment_service (GraphQL) (REST)
- LineItem.fulfillment_service (GraphQL) (REST)

Instead, you should use inventory items and inventory levels if you need to find, or manage, where a product is stocked.

 So it seems that the preferred way to associate a fulfillment service with a product variant is through `InventoryItem` and `InventoryLevel`. We can set an inventory level for the product's inventory item that uses the location of the fulfillment service. However, if the inventory item has tracked = false, then no inventory levels can be set for that item.

 

So, my question is: if we're running a fulfillment service that fulfills digital products via email, where those products have theoretically unlimited inventory, how should we go about associating our fulfillment service with those product variants if we shouldn't be setting the `fulfillment_service` property on them?

The only thing I've come up with is to turn inventory-level tracking on and set inventory levels with some really high quantity. With other code in there to handle the case if it actually gets to zero. Doesn't feel quite right tho.

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 509

This is an accepted solution.

Hey @taylor-single  - generally, for digital products, we recommend that merchants treat them as "non-physical items", but you do bring up a good point about it making fulfillment more difficult.


At the moment, I believe your workaround is what some other developers with similar use-cases have done to mitigate this. Another way you could do this would be to circumvent the Fulfillment API as a whole. For example, you could set your app up to listen to the orders/create or orders/update webhook subscriptions and scrape the value of the variant's plaintext SKU from the JSON payload and its variant_inventory_management value (which will always be null for any "non-physical product"). Using this data, you could trigger your app to send the digital product via email whenever an order for the digital products are captured in a webhook.


That said - I'm also going to put through a feature request on my end. I agree that it would be helpful to have a more efficient way of tracking/"fulfilling" digital/non-physical products. I can't guarantee anything in terms of implementing new features, though.


Hope this helps - let us know if we can clarify anything on our end or if we can add anything to that feature request.


 

Al | Shopify Developer Support

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

ShopifyDevSup
Shopify Staff
1453 238 509

This is an accepted solution.

Hey @taylor-single  - generally, for digital products, we recommend that merchants treat them as "non-physical items", but you do bring up a good point about it making fulfillment more difficult.


At the moment, I believe your workaround is what some other developers with similar use-cases have done to mitigate this. Another way you could do this would be to circumvent the Fulfillment API as a whole. For example, you could set your app up to listen to the orders/create or orders/update webhook subscriptions and scrape the value of the variant's plaintext SKU from the JSON payload and its variant_inventory_management value (which will always be null for any "non-physical product"). Using this data, you could trigger your app to send the digital product via email whenever an order for the digital products are captured in a webhook.


That said - I'm also going to put through a feature request on my end. I agree that it would be helpful to have a more efficient way of tracking/"fulfilling" digital/non-physical products. I can't guarantee anything in terms of implementing new features, though.


Hope this helps - let us know if we can clarify anything on our end or if we can add anything to that feature request.


 

Al | Shopify Developer Support

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

taylor-single
Shopify Partner
21 2 30

@ShopifyDevSup I appreciate the response!

We're actually already doing the method you're describing for fulfillment, i.e. listening to webhooks and triggering our fulfillment process off of that.

Where our usage of the fulfillment/fulfillment_order API comes in is after we perform the fulfillment we make requests to Shopify to mark those line items fulfilled on the orders.

But anyway, yeah I think in general the APIs/processes are centered around physical goods (which makes sense, most stores are selling physical goods), but it can make for some awkward flows for fulfilling digital products. The key one here is that there's seemingly no way to associate a fulfillment service with a product variant where inventory doesn't matter.