Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi! I have created a flow that emails me when there is a failed payment attempt on an order... it works fine, but what I'm looking for is multiple declines on the same order.
For example, a person may innocently input the wrong zip code or CVV and get a decline error once or even twice, but then enter the info correctly and successfully place their order. I'm not really worried about those scenarios. I want to be notified if there are more than THREE payment attempts ("declined" error code or "failed" transaction status).
As mentioned, I have a flow in place to let me know of one failed payment attempt. Does anyone know if Shopify Flow is able to "count" the number of payment attempts on a given order and only trigger the action if the condition has happened a certain number of times?
Thanks for any ideas!
What trigger are you using currently for the single failed payment flow?
Hi Kalen! I have tried it two ways:
Both of these successfully trigger an internal email, but I'm not sure how to tell Flow to only trigger if it happens three times on the same order.
I'm not too familiar with how the transaction events come through. Are you seeing the workflow trigger 3 times using Order transaction created?
If so, you could store them in a metafield or tag each time they happen. And then check the metafield before sending that internal email.
You might also be able to use something like:
Yes, I do get multiple email notifications for repeat events on the same order for the card decline, but the transaction status failure flow only triggers once.
I'll try the flow you suggested, but not sure on some of the steps. Here's what I have:
Is this right? Seems a little convoluted?
Yeah, I think if the trigger works then it will be the easiest for you.
If you go with "Get data" then I would use Run code instead of the condition and count above. It gives you a lot more flexibility and you won't have to write logic twice. Usually, I prefer to return the full string for the email body plus a boolean to use in a condition (something like "hasThirdDecline")
hello,
checking in to see if this worked? I have many people who try and scam us by charging mulitple stolen cards. Sometimes up to 12 different cards that fail.
if it has worked, can you write the steps in detail? sorry, im new to this!
thank you!
Yes! The below flow has been working great for me!
The count function will obviously count successful charges, too, so find a number that makes sense for you. To me, if someone's credit card gets declined 4 times, that's enough to justify a fraud flag. (4 declines + 1 successful authorization = 5 transactions) I have my flow set up to add an order tag, add an order note for the warehouse, and email me). I take a look at the activity, and if it's the same card declined 4 times, that's obviously someone who has fat fingers or doesn't know their billing address and I usually let those process. But if it's 4 declines with 4 different cards, I manually cancel the order.
Hello,
I did the following based on what you said, but wanted to confirm I'm choosing the correct actions.
1. Order Created > THEN
2. IF "transactions_item.status" equal "failure" OR "transactions_item.status" equal "error" > THEN
3. ACTION > COUNT "order.transactions" > THEN
4. IF Count equal to 4 > THEN
5. ACTION >
whatever I want
I set 4 to allow customers 3 tries of failure and they need to get it on the 4th try or they are out.
Thanks for popping back into the thread with your help!
Looks good! I would just suggest "greater than or equal to" as the count qualifier, because the way you have it written, the number of transactions on the order has to be exactly 4 to auto-cancel the order.... and if you have one of your 12-attempt scam orders come through, it won't trigger the last action.
Hello Rossiedee,
Thanks for that catch. I misread your initial msg, but have made the changes. Thank you for all your help!
No problem! Happy to help!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025