Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi there! Does anyone have any flows worked on that can check if a customer appears to be a Return Abuser? I am having issues trying to figure out how to notify myself on customer's that have placed 3 or more orders where the net sales are less than $150 to try to see who routinely returns their order so that I can work on blocking them as a future customer. I've looked into the Fraud Filter app but it doesn't look like it can do the checks I want. I've touched based with Shopify Support and it also doesn't appear that the Flow app can check all orders in history so I'm at a bit of a loss as what to try next. Any advice or suggestions would be greatly appreciated!
Solved! Go to the solution
This is an accepted solution.
Hi KWILSON117,
So there's a couple of ways which Flow could be useful depending on your exact use case. The criteria you mentioned (3 or more orders and less than $150) can be modelled in flow as shown in the screenshot below by looking at the order.customer.numberOfOrders and order.customer.amountSpent.amount fields that come from an Order created trigger. This will include the current order as well as all previous orders, so if they are returning their order the current order may put them over the $150 threshold.
If your goal is to create a notification when a customer who previous had a return creates a new order, something more like the following workflow may be better. The workflow will fetch all previous orders from the customer that are in some state of a return, count how many there were and then check if that number is greater than zero before sending a notification.
To do this, you'll want to use the following query in the Get order data step's Advanced query mode and ensure you set the Maximum number of orders to 100.
customer_id:{{order.customer.legacyResourceId}} AND return_status:"return_requested,in_progress,returned"
Hope that helps!
This is an accepted solution.
Hi KWILSON117,
So there's a couple of ways which Flow could be useful depending on your exact use case. The criteria you mentioned (3 or more orders and less than $150) can be modelled in flow as shown in the screenshot below by looking at the order.customer.numberOfOrders and order.customer.amountSpent.amount fields that come from an Order created trigger. This will include the current order as well as all previous orders, so if they are returning their order the current order may put them over the $150 threshold.
If your goal is to create a notification when a customer who previous had a return creates a new order, something more like the following workflow may be better. The workflow will fetch all previous orders from the customer that are in some state of a return, count how many there were and then check if that number is greater than zero before sending a notification.
To do this, you'll want to use the following query in the Get order data step's Advanced query mode and ensure you set the Maximum number of orders to 100.
customer_id:{{order.customer.legacyResourceId}} AND return_status:"return_requested,in_progress,returned"
Hope that helps!
Thank you so much for this answer! I also had this question!
Is it possible to modify this to count the number of returned items (instead of returned orders) for the customer? For example, I have customers that will order multiple items in a single order and return some of them, and I would like to count how many they have returned overall vs how many they have kept. Thanks!
That would be amazing to track as well!!
Hi Mattsirkin,
You can do that, but you'll need to use the Run Code action to sum all the quantities across all the Orders. Here's an updated example:
With the following Run Code step setup:
Input Query:
query{
getOrderData {
returns {
totalQuantity
returnLineItems {
quantity
}
}
}
}
Output type:
"The output of Run Code"
type Output {
"The total number of items returned by this buyer"
totalReturnedItems: Int!
}
And the code itself:
export default function main(input) {
// Make sure that the data you return matches the
// shape & types defined in the output schema.
let totalReturnedItems = 0;
input.getOrderData.forEach((order) => {
order.returns.forEach((returnItem) => {
totalReturnedItems += returnItem.totalQuantity;
});
});
return {
totalReturnedItems,
}
}
Hope that helps!
Thank you so much!
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024