#salim-bt_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/1389962124364873738
📝 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.
- salim-bt_api, 1 day ago, 25 messages
Hi 👋 did you make a request to set that as the default payment method for the Customer?
Or are you talking about setting the default payment method for a Subscription?
It's hard to tell without more context
2nd
setting the default payment method for a Subscription
cus_Sbe2lXyPdpByfw
you can check
the card not marked as default
What is the ID of the Subscription? (that's more important if you want to set the default on the Subscription level)
sub_1RgQkdBZmGtUq60jSe8rd92a
default_payment_method is set there
Is this our Customer Portal?
here why i do not see default?
yes
If so, that won't show the default payment method for Subscriptions. It shows the default set at the Customer level, and that Customer doesn't have a default payment method set.
now if i set this as default, the sub will use this card to renew?
The Subscription will use the default_payment_method that it has set, that takes priority over the default payment method set at the Customer level.
default_payment_methodnullable string Expandable
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence overdefault_source. If neither are set, invoices will use the customer’sinvoice_settings.default_payment_methodordefault_source.
https://docs.stripe.com/api/subscriptions/object?api-version=2025-06-30.basil#subscription_object-default_payment_method
hmmm and how change default card for Subscription level?
Update the default_payment_method field on the Subscription object
i thought changing default card of Customer level will change sub default card
Nope, not if you just update the Customer object, but I'm not sure if that's what you're talking about doing
these customer cards
if change default here, it will not effect default card of sub
Okay, so you're still talking about setting things in the Customer portal. I think that UI gives you an option to have the change cascade to all Subscription? (we focus more on helping developers work with our API, so sometimes I need reminders about what you're seeing if you're using hosted flows instead)
ok last Q after buy sub how i can set default in customer level?
Via our API? By making a request to update the Customer object and set the invoice_settings.default_payment_method field.
ok thank you Toby!
Any time!
when buy sub default_payment_method field on the Subscription not required right?
if not set it, it means this sub will use default card in customer level?
Correct
cool
still here?
about this
is it means if customer not have any card, and then if he add first card , it will set as default auto?
i tested it but card not set as default
Can you share the request id where you attempted this?
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.
req_LLR36crgfgdGmC
That's a different endpoint from your screenshot entirely
POST /v1/customers/:id/sources is the endpoint from your screenshot
You're calling POST /v1/payment_methods and then POST /v1/payment_methods/pm_1RgRmsBZmGtUq60juBc3fP59/attach
So expected behavior is totally different
i do this
and where is default?
it's first card as you see
ah you mean this not for payment methods?
Correct
Only for the endpoint in your screenshot
Which is POST /v1/customers/:id/sources
in my case i still need to make it default by myself
Correct
when use wallets to buy sub, how i can set customer card as default?
You can set it at the subscription level: https://docs.stripe.com/api/subscriptions/object#subscription_object-default_payment_method or the customer level: https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method
Up to you
Read the description of both of those params to see what makes the most sense for your use-case
Up to you really
But that makes the most sense
Because then you know the payment method had a successful payment
cool
i have other Q
sec please
i want to prevent save same card
i use payment method api
also i use stripe express element for wallets
See above link
if card same, card will not be created right?