#alexis-subscriptions-list
1 messages · Page 1 of 1 (latest)
Hello alexisadeveloper, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• alexisadeveloper, 1 hour ago, 6 messages
• alexisadeveloper, 5 days ago, 3 messages
• alexisadeveloper, 6 days ago, 8 messages
• alexisadeveloper, 6 days ago, 4 messages
• alexisadeveloper, 6 days ago, 7 messages
Hi 👋
So you want the API to return all the canceled subscriptions as well as active ones?
Can you share the API request ID for one of these requests?
It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Hi, of course: req_HiSVkYXKFVWEfQ
that one is with the starting_after parameter
This one without req_uErDXh7lQhqXu8
In total the funciton makes 2 list requests
Since you are using our Node.js client library, have you tried using our autopagination feature?
It could. It is my preferred method of pagination using our client libraries and I haven't run into the issue you are describing. It could be worth a quick experiment to see if it works better for you. Here is the section of our API ref doc with an example: https://stripe.com/docs/api/pagination/auto
trying this out right now, thank you
So i am doing this
for await (const subscription of stripe.subscriptions.list({ limit: 100 })) { subscriptions.push(subscription); }
and this is returning even less results than the pervious function (I am only getting 43 subscriptions)
I am not seeing you use the .autoPagingEach(function(customer) {functionality there
That is the part that automates the pagination
I just did this and it once again printed 199 subscriptions
Also when changing status in this function to be equal to "all", for await (const subscription of stripe.subscriptions.list({ limit: 100, status: "all" })) { subscriptions.push(subscription); } I also got 199 subscriptions
its weird that it stays at 199 subscriptions consistently throughout these different trials, but on the dashboard it has 290
Can you identify one of the additional subscriptions that are not being returned in the API and share the ID here?
These are a few sub_1NnzUKEwHpTUe8W7uBhRHosF, sub_1NpqHuEwHpTUe8W7rCCgj0iT, sub_1NvG5TEwHpTUe8W7WyXGrvJC
Oh okay. Are you making a separate request to get the canceled subscriptions? From our API ref doc
By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
no I am making a single api call with status: "all"
some of the ones that arent being returned by the list are active, some not. I couldn't really establish a pattern
Well we should only be returning canceled subscriptions if you specify that you want them (i.e. not returned in an all call). All three of the susbcriptions you shared have been canceled
Hmm, I would've expected "all" to mean including the canceled ones. So should i do two separate calls ? One with "all" as status and one with "canceled"?
I just did this and I again had subscriptions that weren't being returned by stripe. For instance sub_1O5O5AEwHpTUe8W7aaOfJsXV
Hmm okay. that one is showing as active but you are not seeing it when you paginate your responses
Yeah exactly
Hmmm ... But if you query the API for that specific subscription ID, you get it back, correct?
Yes I do
Okay wait a second. The API requests you are showing are in Test mode. Do all these subscriptions exist in Test mode?
Yes they do
And these are within the data retention window for test mode data? https://support.stripe.com/questions/test-mode-subscription-data-retention
Obviously the subscription you shared with me was created 3 days ago so that would be included, but I'm trying to account for all discrepancies
alexis-subscriptions-list
@iron hatch Can you write a script that will list subscriptions and log each id one by one with an index and the exact status so that we can align on what's happening?
Don't make the calls twice like you are doing right now which makes it tough to debug
@iron hatch I'm thinking the issue is with Test Clocks that you are using for some Subscriptions and not all