#shehzadnizamani_docs
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1332238109055914004
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- shehzadnizamani_api, 2 days ago, 15 messages
hello! Is there a reason why you don't retrieve the list of subscriptions using this endpoint instead? https://docs.stripe.com/api/subscriptions/list - you can define the customer id and the status of the subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I will try that API call as well, reason I didn't wanted to use subscriptions/list API call is because I want to get user's one single subscription that is active. And we have set this in our Stripe dashboard that user can only have 1 active subscription
Another reason is I might want subscription with status either "active" or "past_due". So I would need subscriptions of 2 statuses
https://docs.stripe.com/api/subscriptions/list#list_subscriptions-status - If you don't pass in a value, all subscriptions that have not been canceled are returned which seems to fit what you need i.e. subscription with status either "active" or "past_due"
That is not true, I actually don't want subscription with statuses such as "incomplete", "incomplete_expired", "cancelled", "unpaid" and "paused".
But I can filter that out in my code, I can give subscriptions/list API a try as well. But just in case if that doesn't work for my usecase. Could you please answer my original question of Stripe.Customer.subscriptions field, which statuses of subscription it returns?
And I also want to know does Stripe not recommend using Stripe.Customer.subscriptions filed to get user's subscription and recommends using subscriptions/list API call instead?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Stripe.Customer.subscriptions field, which statuses of subscription it returns
It seems to return the same information as list subscriptions without passing in a value to status i.e. all subscriptions that have not been canceled are returned
And I also want to know does Stripe not recommend using Stripe.Customer.subscriptions filed to get user's subscription and recommends using subscriptions/list API call instead
I recommend that you use list subscriptions instead because when you use expand, at a high level, behind the scenes, Stripe will first need to retrieve the customer information and also retrieve the corresponding subscriptions which will result in the request taking a slightly longer time than you simply requesting for the list of subscriptions for that customer instead
you would use expand on subscriptions on customers, only if you need the customer information alongside the list of subscriptions
Ok thank you, all this makes sense to me, I will use subscriptions/list instead then