#davidgs_api
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/1225469074994102353
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
You need to use this endpoint: https://docs.stripe.com/api/subscriptions/list#list_subscriptions-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That works, if you already have the subscription ID: const subscription = await stripe.subscriptions.retrieve( 'sub_1MowQVLkdIwHu7ixeRlqHVzs' );
I need to retrieve the Subscription ID for a customer.
Click the link i sent
That's not the endpoint I linked
The one I linked allows you to pass customer id
I did click on the link you sent. And the code I went back is copied/pasted from that page. If all I have is the customer ID ... Or do I now have to start storing the subscription ID in my local db?
You didn't click the one I sent
If you did yo'd see:
const subscriptions = await stripe.subscriptions.list({
limit: 3,
});
Yes, I most certainly did.
not stripe.subscriptions.retrieve
Great, how is that going to know which customer?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Customer is an available param
so pass customer: customer id
That was a lot harder than it needed to be. #docsfail
How so? It's 1 api request. Or do you mean it was difficult finding it in the docs?
It was nearly impossible to find in the docs. And I've spent almost an hour on this. ๐ฆ
I have a lot of trouble with your docs, in general. Can't find things that I think would be useful, like a comprehensive list of all the event types, etc. I end up going from page to page to page and only getting incomplete info.
Here's a list of all event types: https://docs.stripe.com/api/events/types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
A complete guide for "if you're taking electronic payments via stripe, here are all the events you need to handle" would be fantastic. Maybe once I'm done with this integration I'll write it.
Thanks for the help
Yeah it's tricky to do that because there's so many stripe products and so many events. The event types one person may need to listen to might be totally different from another person