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

Topic summary

A user is attempting to create a Shopify Flow that sends an internal email notification when a customer pays an overdue order with Payment Terms. They’re struggling with the correct implementation, specifically around checking if paymentSchedule.amount.amount <= 0 to determine payment status.

Key Issue:
The advanced query condition for checking payment schedule amounts isn’t working as expected.

Recommended Solution:
Switch from the current trigger to the “Order Paid” trigger instead. This trigger provides better access to payment data through totalReceivedSet > presentmentMoney > Amount rather than PaymentTerms > PaymentSchedules.

Current Status:
The user confirmed that amount is not currently available within PaymentTerms > PaymentSchedules. Shopify support recommends using the Order Paid trigger’s totalReceivedSet path to check if an already-paid order’s value equals or is less than zero, which better suits the workflow goal of detecting when overdue Payment Terms orders are paid.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

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.

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.

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:

1 Like

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

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!

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.