#davidgs_api

1 messages ยท Page 1 of 1 (latest)

stoic cometBOT
#

๐Ÿ‘‹ 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.

toxic oreBOT
opal sky
blissful zodiac
#

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.

opal sky
#

Click the link i sent

#

That's not the endpoint I linked

#

The one I linked allows you to pass customer id

blissful zodiac
#

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?

opal sky
#

You didn't click the one I sent

#

If you did yo'd see:

const subscriptions = await stripe.subscriptions.list({
limit: 3,
});

blissful zodiac
#

Yes, I most certainly did.

opal sky
#

not stripe.subscriptions.retrieve

blissful zodiac
#

Great, how is that going to know which customer?

opal sky
#

Customer is an available param

#

so pass customer: customer id

blissful zodiac
#

That was a lot harder than it needed to be. #docsfail

opal sky
#

How so? It's 1 api request. Or do you mean it was difficult finding it in the docs?

blissful zodiac
#

It was nearly impossible to find in the docs. And I've spent almost an hour on this. ๐Ÿ˜ฆ

opal sky
#

I see

#

Sorry about that

blissful zodiac
#

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.

opal sky
toxic oreBOT
blissful zodiac
#

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

opal sky
#

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