#alexis-subscriptions-list

1 messages · Page 1 of 1 (latest)

versed lagoonBOT
#

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

abstract inlet
#

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?

iron hatch
#

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

abstract inlet
#

Since you are using our Node.js client library, have you tried using our autopagination feature?

iron hatch
#

No i havent yet

#

Would that make this procedure easier?

abstract inlet
#

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

iron hatch
#

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)

abstract inlet
#

I am not seeing you use the .autoPagingEach(function(customer) {functionality there

#

That is the part that automates the pagination

iron hatch
#

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

abstract inlet
#

Can you identify one of the additional subscriptions that are not being returned in the API and share the ID here?

iron hatch
#

These are a few sub_1NnzUKEwHpTUe8W7uBhRHosF, sub_1NpqHuEwHpTUe8W7rCCgj0iT, sub_1NvG5TEwHpTUe8W7WyXGrvJC

abstract inlet
#

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.

iron hatch
#

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

abstract inlet
#

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

iron hatch
#

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"?

abstract inlet
#

Our docs explicitly state this is not the case

#

that is why I quoted them

iron hatch
#

I just did this and I again had subscriptions that weren't being returned by stripe. For instance sub_1O5O5AEwHpTUe8W7aaOfJsXV

versed lagoonBOT
abstract inlet
#

Hmm okay. that one is showing as active but you are not seeing it when you paginate your responses

iron hatch
#

Yeah exactly

abstract inlet
#

Hmmm ... But if you query the API for that specific subscription ID, you get it back, correct?

iron hatch
#

Yes I do

abstract inlet
#

Okay wait a second. The API requests you are showing are in Test mode. Do all these subscriptions exist in Test mode?

iron hatch
#

Yes they do

abstract inlet
#

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

wary trail
#

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