Fulfillment Constraints Function - No way to identify which delivery method triggered execution

Hey everyone,

I’m running into a frustrating issue with fulfillment constraints functions and hoping someone has found a workaround or can confirm this is a platform limitation.

The Problem:
When building a fulfillment constraints function that’s configured for multiple delivery methods (like both shipping and local pickup), there’s no reliable way to determine which specific delivery method is currently being processed during function execution.

What I’ve tried:

  • Checking cart.deliveryGroups[].deliveryOptions[] - but this is always empty when the function runs
  • Looking at cart.deliveryGroups[].selectedDeliveryOption - also null

Expected behavior:
The function input should include some indication of which delivery method context triggered the execution, especially when the function is enabled for multiple delivery types.

Current workaround:
Right now I’m having to create separate function instances for each delivery method, which feels like overkill, and there is also no docs about how constraints work in parallel.

Use case:
I need different constraint logic for local pickup vs shipping. For example, certain products should have different location restrictions depending on whether the customer is picking up or having items shipped.

Has anyone else run into this? Is there a field I’m missing in the GraphQL schema, or is this just how Shopify works rn? Would love to avoid the multiple function approach if possible.

Hey @blanklob, thanks for waiting on us here.

I did some digging into this with our engineering team and they confirmed that creating separate function instances for each delivery method is currently the recommended approach.

We do agree that having something like executionContext.deliveryMethodType in the function input would be useful though, but this capability doesn’t exist today. We’ve gone ahead and created a feature request to potentially add this functionality in the future, but I can’t provide any guarantees on timeline or implementation. For now, the multiple function approach you mentioned is the way to go. Hope this helps, let me know if I can clarify anyhting on our end here.

Got it, thanks! that what were currently doing.

1 Like