Hi,
We’re developing a trigger for a common merchant use case, which is to release/place a hold on an order after the customer is verified by our system.
Our trigger emits an order reference, but when I attempt to use the Shopify Admin - Release fulfillment hold action, the requisite for that action is an FullfillmentOrder object:
So I attempted to find a Shopify Admin - Get FullfillmentOrder action that accepts a specific Order, but the only action available at this time is Shopify Admin - Get fulfillment order data which queries for all FullfillmentOrders.
Is there an action I’m missing that will retrieve an particular order’s corresponding FullfillmentOrder? Or do I need to use an advanced query with the existing action and apply the release/hold to each one?
Thanks for any guidance!
A single order has one to many FulfillmentOrders, and I need to use the Shopify Admin API - Retrieve fulfillment orders to retrieve all fulfillment orders and release/hold them.
Constraints:
- The Shopify Admin API - Retrieve fulfillment orders can only retrieve up to 100 FulfillmentOrders
- You can’t define an
order_id as a parameter to the filter
So therefore, the only way to filter is by using the range of order.fullment_order.updated_at timestamps to query a range using the updated_at filter.
I tried a bit of looping liquid with variable assignments in the Advanced query filter. But no luck, I don’t believe that looping is supported.
I guess the only workaround at this time is for us to publish our own Get fulfillment orders for order action that users can use to retrieve all fulfillment orders.
Not a great solution, we’d much prefer to use built in Shopify Admin API actions to retrieve all Order Fulfillments given an order reference.
You could use a Foreach (docs) loop to iterate over all the fulfillment orders on the order, and then apply the Hold fulfillment order to each of them. Foreach has a limitation of 100 items, but I think that should be sufficient for fulfillmentOrders.
Below is a screenshot where I’m using the “Order created” trigger:
1 Like
Thank you @Steve_L !
I can’t believe I didn’t think to reach for the Loop action to go over each of the order’s OrderFulfillments and then apply the action to each one.
That works like a charm! Thank you.