How to getOrderData "paymentSchedule.amount.amount is less than or equal to 0"

Solved

How to getOrderData "paymentSchedule.amount.amount is less than or equal to 0"

EunorauEbikes
Excursionist
18 0 2

I have been trying to create a flow that once the customer pays the "overdue" order with PaymentTerms, then sends me an internal email notification.

 

005.jpg

and also i got a reply from Shopify support for reference:

if (paymentSchedule.amount.amount <= 0) {

// Payment is made

return true;

} else {

// Payment is not made

return false;

}

 

So the questions:

1, The code in the "advanced query" part - “paymentSchedule.amount.amount <= 0”  is correct or not? or something else still need to be added???

2, Which “Sort data by” should i choose (*It is also a key point for flow, right?)

 

Thank u for ur help in advance!

*This flow is very important for my work,  i have tried many different versions to make it work in the past weeks.

Accepted Solution (1)

Mat_w
Shopify Staff
3 1 1

This is an accepted solution.

Hello! If you are looking to get an email for each paid order, I'd recommend switching to the "Order Paid" trigger instead.

With that you can make a check if all the PaymentTerms -> PaymentSchedules of the order are less than or equal to 0.

 

This is a sample workflow that could achieve that:

 

Mat_w_0-1718224512713.png

 

Mat_w | Flow Software Developer @ Shopify
- Finding Flow useful? [Leave us a review](https://apps.shopify.com/flow/reviews)
- Need Flow help? Check out our [help docs](https://help.shopify.com/en/manual/shopify-flow).
- Building for Flow? Check out [Flow's dev docs](https://shopify.dev/docs/apps/flow).

View solution in original post

Replies 4 (4)

Mat_w
Shopify Staff
3 1 1

This is an accepted solution.

Hello! If you are looking to get an email for each paid order, I'd recommend switching to the "Order Paid" trigger instead.

With that you can make a check if all the PaymentTerms -> PaymentSchedules of the order are less than or equal to 0.

 

This is a sample workflow that could achieve that:

 

Mat_w_0-1718224512713.png

 

Mat_w | Flow Software Developer @ Shopify
- Finding Flow useful? [Leave us a review](https://apps.shopify.com/flow/reviews)
- Need Flow help? Check out our [help docs](https://help.shopify.com/en/manual/shopify-flow).
- Building for Flow? Check out [Flow's dev docs](https://shopify.dev/docs/apps/flow).
EunorauEbikes
Excursionist
18 0 2

Thank u for ur advice, it's a big help to me, i will try it now

EunorauEbikes
Excursionist
18 0 2

Moreover, if advanced query part is filled with:

{

orders(first: 10, query: "paymentStatus:PAID") {

edges {

node {

id

paymentSchedule {

amount {

amount }

}

}

}

}

}

Does it works for this flow? Because i still wanna add order tags, like 

{{paymentSchedule.dueAt}}, 
{{paymentSchedule.completedAt}}
ect.

Thanks for ur answers!

EunorauEbikes
Excursionist
18 0 2

Update:

Amount is currently not available with PaymentTerms > PaymentSchedules. 

The amount criteria is with the "Order paid" trigger. It would start with totalReceivedSet > presentmentMoney Amount.
Essentially, since your goal is to send an internal email if an order is already paid and the value is less than or equal to zero, our team recommends using Order paid > totalReceivedSet > presentmentMoney > Amount in place of Order paid > PaymentTerms > PaymentSchedules.