-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
products.list throws error when ids array is larger than default limit value (10) #1464
Comments
@rconjaerts Could you give a bit more details and an exact reproduction? I tried the following code which works fine whether I pass a
I tried with various alternatives, with and without more than 10 real product ids and couldn't reproduce. |
My apologies for the late reply, I have to change my notification settings properly. It's weird that you don't seem to have this issue. Our complete function that we're using is the following.
I've also added logs from our import service that threw the error:
Note that in logs in the array of products, I removed the actual ids and replaced it by XXXXXXXXXXXX as a security measure. If I add |
@rconjaerts Can I ask you to provide an exact script to simply reproduce the exact issue end to end? Your function help but if you could share exact end to end code that would make things a lot easier. |
Sure, I ran this with
|
Thanks, I was able to reproduce after tweaking that code. It seems we don't support getting to the next page in this case but don't document it. We'll investigate whether this is a real bug we need to fix or more a feature request we hadn't encountered before. Tagging as future for now but I'm definitely surprised by this behaviour. |
Quick fix would also be to allow a higher |
We would never allow the limit higher than 100 so that won't be a potential solution. You mostly need to split your list in smaller chunks or cache this in your database instead. |
Describe the bug
When you try to retrieve a list of products via the
products.list()
function, and you add anids
parameter whose array size is larger than the defaultlimit
value (10), Stripe will throw anStripeInvalidRequestError
. The message and param of the error is the following:To Reproduce
Expected behavior
The length of the array of ids shouldn't be constrained by the limit parameter
Code snippets
No response
OS
macOS
Node version
v16.13.2
Library version
stripe v9.6.0
API version
2020-08-27
Additional context
No response
The text was updated successfully, but these errors were encountered: