Invocation ID : 085af0fd-9c40-4b41-95a9-88c69d3da20f
Shop : coffeetoolskw.myshopify.com
Output :
{
"operations": [
{
"deliverableLinesMustFulfillFromAdd": {
"deliverableLineIds": [
"gid://shopify/DeliverableCartLine/0"
],
"locationIds": [
"gid://shopify/Location/90752909536"
]
}
},
{
"deliverableLinesMustFulfillFromAdd": {
"deliverableLineIds": [
"gid://shopify/DeliverableCartLine/1"
],
"locationIds": [
"gid://shopify/Location/78659092704"
]
}
}
]
}
From the logs of the function, the function seems to executed correctly, but the actual created order is using the default fulfillment location (which is different than the two locations specified in the output)
The cart is from a draft order, it seems like there was a failure for the function, but there was no error or anything.
Hi @soulchild, which date did that Function invocation run? I’ve checked our logs but wasn’t able to find a run with that invocation ID.
The function invocation run at 18 August 2026 , 13:47 UTC time .
The corresponding order ID created from this cart is gid://shopify/Order/6957469073632
Draft order ID that is used to invoke the function is gid://shopify/DraftOrder/1346095612128
Please let me know if you require more info, thank you.
Thanks for sharing @soulchild.
On reviewing our logs, I found that the Function ran successfully, but its constraints could not be satisfied. Neither specified location could fulfill its corresponding line item due to inventory availability, so the constraints were discarded and routing fell back to the default location. Because the Function itself completed successfully, this did not appear as a Function error.
Hi Paige, thank you for looking into it.
From the documentation (Fulfillment Constraints Function API) , it mentioned " If the cart items with fulfillment constraints applied aren’t available at the same location or any of the listed locations, then buyers won’t see any shipping options at checkout. Instead, a message will show which items are out of stock, preventing the buyer from completing the purchase."
However in this case, even if the locations did not have the inventory available, the shipping rate is still shown and customer is still able to checkout, which is not what the merchant intended, the merchant would rather the checkout blocked, than silently switched to the default location.
Is there a mistake on the documentation?
I had the same question, so I dug into that invocation and reproduced the behavior on a test shop.
What happened on that order:
- A draft order was created in the admin.
- A custom shipping rate was entered by hand on the draft, rather than using an existing rate.
- Your function ran successfully and returned both constraints: one item to location 1, the other to location 2.
- Neither named location could fulfil its item for that destination. Before constraints are applied, Shopify works out which locations can actually fulfil each item, and for both items the only qualifying location was location 3. Applying your constraints removed that single option and left nothing, so rather than stopping the order, Shopify assigned location 3 to both items.
- The order completed through the admin for location 3, with no error recorded on the function run and no notice to the app or the merchant.
Silent fails happen in two scenarios: completing a draft order in the admin and using a custom shipping rate. When the customer completes through the invoice checkout with one of the store’s shipping rates, the constraint is enforced and the order is blocked, exactly as the documentation describes. The documentation doesn’t cover those two draft order scenarios though, so I’m flagging both the behavior and the documentation gap with the team that owns it.
As a workaround for now, don’t add a custom shipping rate to the draft or complete the order in the admin. Instead, send the invoice and let the customer complete checkout using the store’s shipping rates.