#elBR-preview-invoice

1 messages ยท Page 1 of 1 (latest)

viscid tapir
#

Hi there ๐Ÿ‘‹ I believe you can pass an empty string to discounts.coupons to avoid inheriting other coupons/discounts:
https://stripe.com/docs/api/invoices/upcoming?lang=python#:~:text=Pass an empty string to avoid inheriting any discounts.
But please let me know if that doesn't do what you're looking for.

urban narwhal
#

ok thank you

#

I have another question

#

I want to retrive all draft invoices but I see that I must provide a limit

#

if I do not provide it by default is 10

#

but even if I provide, max is 100

#

then how can I retrive all invoices even in case there are more than 100

#

I want to make a search and for that I want to get all invoices

viscid tapir
#

You will need to use some form of pagination to step through the pages of returned objects. This section talks about the basics of the fields we provide for building pagination in our API:
https://stripe.com/docs/api/pagination
But this section discusses the auto-pagination that is built into our libraries:
https://stripe.com/docs/api/pagination/auto

Alternatively, if you're interested in searching Invoices then you could use this endpoint to perform a search through your Invoices:
https://stripe.com/docs/api/invoices/search

urban narwhal
#

undefined method `search' for Stripe::Invoice:Class

#

I am using ruby and I get this error

#

I am trying to use Stripe::Invoice.search

viscid tapir
urban narwhal
#

query: 'status=draft AND metadata['order_id']:'6735''

#

I get this error

#

"Field status is an unsupported search field

#

I also tried 'status='draft' AND metadata['order_id']:'6735''

#

can I search by status?

viscid tapir