#alecpope
1 messages · Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Sure:
Request when searching for the first subscription: req_7G6YtthoDqzKkV
Second request: req_cRs4RgR3Yo6oqO
Thanks, was these two subsciptions created recently?
One of them, yes. The other one no. But they have the same creation time, because I appended a test clock to the customer
out of curiosity, why aren't you using our inbuilt pagination? https://stripe.com/docs/api/pagination/auto
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Didn't know about this :D
But can I use it in my use case? I have an endpoint to list subscriptions of a user. I want to paginate the subscriptions. When looking on auto pagination, I don't think this can be applied to an API request, or?
it works if you list subscriptions for a user using our SDK to retrieve the list of subscriptions
Then I currently don't know how? I use subscription.Search(¶ms) to pass in the query, page, etc.
the page that i provided has examples in the relevant language, maybe try modifying it accordingly and see if it works?
The problem is that the auto pagination resets, when sending a new request. So when the user wants the first 10 subscriptions and then sends a new request to receive the next 10 subscriptions, the user still receives the first 10
@edgy girder What do you mean by auto pagination resets?
It starts at the first subscription again
I mean, I also create a new list request, when the user sends a new request
https://stripe.com/docs/api/subscriptions/list?lang=cli#list_subscriptions-starting_after you can also specify a starting_after when listing subscriptions, if auto pagination is not what you want
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah that could work. When listing subscriptions, are they sorted by creation date?
But why is the pagination with page not working? Is it a bug? Am I using it wrong?
Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
Search API has its limitation
Hmm, okay. How can I list subscriptions and filter by metadata?
Listing API doesn't accept metadata, only Search API does. So you need to consider the limitation when using the Search API
Okay, thanks! So when listing subscriptions: I use the id of the last subscription from the list to pass it as starting_after in the next request?
Yes you are right
Okay, it works. Great, thanks!