#farazpatankar

1 messages · Page 1 of 1 (latest)

final tundraBOT
coral hazel
#

There isn't unfortunately. You would want to write a filter logic on all results I am afraid

old patio
#

I see.

#

For context, we want to be fetching all open invoices tied to a product. Let's assume we have 5k+. This means, I'd have to call list with limit: 100 and paginate over them until I get all of them and then filter with custom logic?

coral hazel
#

Yeah, you can use auto pagination too. Also when looping for result you would want to only pick if the product id = your desired id

old patio
#

Nice, auto-pagination seems really cool. So I can basically auto-paginate over all open invoices and dump the ones I want into an array and then operate over said array.

coral hazel
#

Yep

old patio
#

Cool, do you think it makes sense to use this flow long term? I was wondering if it's better to run this as a one-off script and for the future, tag the invoices with their product ID in the metadata and then use the Search invoices flow instead?

coral hazel
#

So it's technically the same, and yes I think it makes sense

old patio
#

Yeah, I know. What I meant was I could add metadata when we created the invoice. For example: metadata: { productId: "ABC123" } and then search by the metadata field?

coral hazel
#

Yeah that works but it relies on you set the metadata correctly