Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Get a list of draft order invoices sent exactly 3 days prior to scheduled run date

Get a list of draft order invoices sent exactly 3 days prior to scheduled run date

nyctibius
Tourist
9 0 1

Hi,

 

Is it possible to get a list of draft order invoices sent exactly 3 days prior to scheduled run date using Flow's advanced query under "get draft order data"? I have tried:

 

invoice_sent_at:='{{ scheduledAt | date_minus: "3 day" }}'

 

and 

 

draft_order.invoice_sent_at:='{{ scheduledAt | date_minus: "3 day" }}'

 

But I am always getting a whole list of draft order invoices sent since about 3 months ago. 

 

Thanks in advance.

Replies 3 (3)

paul_n
Shopify Staff
1431 157 332

Are you using "Get draft order data" as the action? Don't make up filters but instead using the documentations that is linked from the action in Flow. That should lead you here: https://shopify.dev/docs/api/admin-graphql/2024-07/queries/draftOrders#argument-query

 

There is no "invoice" filter on that query. There isn't a invoice query yet available in the API, so Flow cannot build an action to do that. 

 

 

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.
nyctibius
Tourist
9 0 1

I did use "Get draft order data" as the action. So is there no way to send out reminders for draft invoices previously sent within a specified period? That is what I am ultimately trying to accomplish. I am trying to identify a list of draft orders with invoices sent 3 days ago, then resend those that are still unpaid, and repeat this process every 3 days. 

paul_n
Shopify Staff
1431 157 332

If you are sending invoices with flow, you could potentially tag the draft orders with something and then use the tag to find them later. 

 

But there isn't another way to do it as the data just isn't available

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.