#barba_code
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/1308042875031912528
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
👋 happy to help
Hey Tarzan, hope all goes well
yes thank you, how about you?
yes you can update the subscription's default payment method at any point in time https://docs.stripe.com/api/subscriptions/update#update_subscription-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Good as well. I just need help with this. I want to know if there is an easy way to do what I am asking for or if is not a simple way make sure I can create something on my side to go one by one in some way, in this second option I would like to know if there is a limit of request I can do to stripe
where would you get the dpm from for each subscription?
Ok, I see I can go 1 by one by the code you sent me
´´
const stripe = require('stripe')('sk_test_9W1R4v0cz6AtC9PVwHFzywti');
const subscription = await stripe.subscriptions.update(
'sub_1MowQVLkdIwHu7ixeRlqHVzs',
{
metadata: {
order_id: '6735',
},
}
);
instead of going 1 by 1, you can list the subscription and filter by status (active)
https://docs.stripe.com/api/subscriptions/list#list_subscriptions-status and then auto-paginate through the subscriptions 1 by 1
https://docs.stripe.com/api/pagination/auto and update the dpm
you just need to make sure to respect the rate limits and best practices described here
https://docs.stripe.com/rate-limits
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, thanks!
I did not check the doc yet, but to get the active subscription list, do we have a filter to retrieve them sorted by the ones that will renew soon?
no you will get them by desc order of creation