#elBR-preview-invoice
1 messages ยท Page 1 of 1 (latest)
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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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
undefined method `search' for Stripe::Invoice:Class
I am using ruby and I get this error
I am trying to use Stripe::Invoice.search
Are you using at least version 5.47.0 of our Ruby library where support for the Search API was introduced?
https://github.com/stripe/stripe-ruby/releases/tag/v5.47.0
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?
No, status is not a supported query field for Invoices:
https://stripe.com/docs/search#query-fields-for-invoices