What's your biggest current challenge? Have your say in Community Polls along the right column.

Shopify Flow payment reminders

Solved

Shopify Flow payment reminders

AdamYardley
Shopify Partner
9 0 0

Hi all, I am trying to set up Shopfiy Flows to send payment reminders at set intervals (on due date, 3 days past due, 7 days, 14 days, etc.), but I want to send them to custom recipients using the same metafields in this flow https://admin.shopify.com/apps/flow/web/editor/templates/b4dfb34a-33d4-4894-a59b-b571a4af99f2 . The base structure of the payment reminders is here https://admin.shopify.com/apps/flow/web/editor/templates/4d2841f9-1847-499f-8995-f1427f8d4163 .

 

The problem with the payment reminders standard Flow is that it just sends to the main contact of B2B companies, and although you can customise the invoice Flow to add a custom message, a Flow that starts with the 'Payment schedule is due' trigger then fails as it cannot find the correct order ("Ran into exception: Fields: order_id are required but are empty").

 

I would appreciate any guidance anyone can offer.

 

Adam

Accepted Solution (1)
paul_n
Shopify Staff
1433 157 332

This is an accepted solution.

I would remove that For-Each path entirely and instead just get each of the 3 metafield values directly (no looping). Choose "metafield (requires arguments)" instead of metafields. 

 

You cannot currently force an action to use a different ID as it's auto-assigned. But changing that data is has access to should work

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

View solution in original post

Replies 13 (13)

paul_n
Shopify Staff
1433 157 332

Can you post a screenshot of that error and your full workflow?

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
AdamYardley
Shopify Partner
9 0 0

Sure, thanks for replying. Here are the screenshots below

 

Screenshot 2024-11-15 at 15.09.20.pngScreenshot 2024-11-15 at 15.12.01.pngScreenshot 2024-11-15 at 15.10.04.pngScreenshot 2024-11-15 at 15.09.58.png

paul_n
Shopify Staff
1433 157 332

You don't have an "order" available from the trigger. The action is actually using the order attached to the metafield owner, which might be a bug, because I don't think that owner is actually an order in this case but a location. 

 

Probably the path to the order is payment schedule / paymentTerms / order / id (click "Add a variable" to insert it). 

 

I think your logic has issues as well but hopefully that helps you test a bit. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
AdamYardley
Shopify Partner
9 0 0

Thanks Paul, do you know how I would force the Send order invoice action to use the order from that path (payment schedule / paymentTerms / order / id)? At the moment it seems to be fixed on the For each loop and takes the information from that, and there's no way within the Send order invoice action to select the order path

paul_n
Shopify Staff
1433 157 332

This is an accepted solution.

I would remove that For-Each path entirely and instead just get each of the 3 metafield values directly (no looping). Choose "metafield (requires arguments)" instead of metafields. 

 

You cannot currently force an action to use a different ID as it's auto-assigned. But changing that data is has access to should work

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
AdamYardley
Shopify Partner
9 0 0

So I will remove the For each loop and just change it to Check if metafields key is email1 like this, and now the Send order invoice window looks like this. Do you think that will work now?

 

Screenshot 2024-11-15 at 16.15.53.png

paul_n
Shopify Staff
1433 157 332

I think so, although I can't tell what's in that email liquid string

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
AdamYardley
Shopify Partner
9 0 0

As in within the custom message?

paul_n
Shopify Staff
1433 157 332

no the recipient email address. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
AdamYardley
Shopify Partner
9 0 0

It's {{paymentSchedule.paymentTerms.order.purchasingEntity.PurchasingCompany.location.invoiceRecipient1.value}}

 

I have 3 Company location metafields, which are used to capture additional email addresses to send emails to my customers

AdamYardley
Shopify Partner
9 0 0

Also, I am using the metafields (non-argument) variable as I only need to send to extra_invoice_recipient.email1 which I think the below achieves

 

Screenshot 2024-11-18 at 13.20.51.png

paul_n
Shopify Staff
1433 157 332

That condition just checks if that key exists in the list of metafields. It doesn't select it for subsequent actions. I'd expect that it's always true, unless you have locations that do not have an email1. But the liquid you posted previously looks correct. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
AdamYardley
Shopify Partner
9 0 0

Thank you so much Paul. Really appreciate all your help