Hello,
In shop settings I have setup gift cards to be automatically fulfilled, but because merchant is using a 3rd party payment provider this isn’t working. Gift cards are not fulfilled automatically.
So I want to setup a Flow to handle this instead. Once an order ONLY INCLUDING GIFT CARDS (I will do a condition to check this) has been created and payment submitted the order should be automatically fulfilled, meaning email with the gift card should be sent to the customer.
Any advice on how to set this up?
I am struggling with triggers allowing me to fulfill the order. Maybe I need to use Admin API request??
You can probably use orders paid trigger, then a condition to check that all line items are gift cards, there is a property on the line items I believe.
You would need to get the “fulfillment order data” for the order that triggered the request and then “mark as fulfilled” for each of those
Fulfillment orders don’t need to be “gotten” on an order trigger…they are available in Flow via order.fulfillmentOrders (as long as the job has finished that adds them)
You can check something like if none of order.lineItems.product.isGiftCard is False
.
Not sure if you use “Request fulfillment” or “Mark as fulfilled” with gift cards.
Hello guys,
I have the Flow running, but it is fulfilling the wrong order.
Flow looks like this
So first two steps are OK. The Flow is only running when an order is created which only contains gift cards.
I have tried applying a filter for the specific order ID just created in the “Get fullfillment order data” step. I want the order just created to be fulfilled automatically.
But the Flow instead fulfills another order which seems to be the first (oldest) NOT fulfilled order. This is probably caused by the ascending sorting of IDs? But since I have applied the exact order ID as a query filter I would not expect any other order to get in the fulfillment loop? What am I doing wrong??
You don’t need that “Get fulfillment order data” step at all. Just use order / fulfillmentOrders in that For each loop.
FYI, I just wrote up better docs for how to manage getting data from a list to an action when you get a “data not found” issue:
https://help.shopify.com/en/manual/shopify-flow/reference/usage-limits#data-not-found
Thanks a lot Paul. Makes good sense and I am now using your exact solution as the second example in your documentation except I still have an additional step checking for gift cards. Thanks again