#manuel_customer-detached-paymentmethod

1 messages · Page 1 of 1 (latest)

vivid stormBOT
#

👋 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/1469061696588087463

📝 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.

brittle osprey
vivid stormBOT
#

manuel_customer-detached-paymentmethod

sturdy field
#

req_WCDJx5cVi4AWIw
by example, i have this test customer for the same issue and still have the error message

brittle osprey
sturdy field
#

yes, it was detached from the dashboard but after i created the payment method i still have the error

#

this is a new request req_zJX9eQqc49zuNd

#

after i attached the payment method

brittle osprey
#

Sorry but you are not explaining how this is any different. The payment method was detached at 2026-02-05 20:16:14 UTC. The failing request was made at 2026-02-05 20:23:06 UTC after the payment method was detached. This will always fail

sturdy field
#

But then why does it fail if the customer already has a payment method added?
Why do you say it will always fail?

brittle osprey
#

By the time you are making these request, the customer does not have the payment method any more. It has been detached. Once a payment method is detached, it cannot be used.

#

And it's the same with the latest request

  • Payment Method detached (not usable ) - 2026-02-05 20:16:14
  • Failing request - 2026-02-05 20:27:38
#

Every one of these failing requests is attempting to use a payment method that cannot be used.

sturdy field
#

So every time a customer makes a new request and does not have a payment method, or their previous payment method has been deleted, will I have to update it for them?

brittle osprey
#

I don't know enough about your integration to say why these payment methods are being detached, that is something you will need to review and understand

sturdy field
brittle osprey
#

Yes, that is where at least one of the payment methods was removed.

#

Your integration needs to check for this before you attempt to create a Subscription

sturdy field
#

Is it possible that when a subscription is canceled in Stripe, the payment method is automatically deleted? Because in my project im not deleting this data

brittle osprey
#

No

#

I've shown you where these payment methods are being detached. Once was from a Customer using the customer portal and another was done from the Stripe Dashboard

#

These are things you or someone else with access to your Stripe account are doing

sturdy field
#

I understand, but then every time a payment method is updated or a new one is added, I would never be able to update the subscription because that error would appear saying that the payment method ID does not match. Is that right?

#

Why does it take the old ID that no longer exists?

brittle osprey
#

That is not correct

#

Updating a payment method does not detach the old ones

#

You need to review your integration to understand why this is happening

vivid stormBOT
sturdy field
#

You didn't answer my question, so what would be the best thing to do?

misty laurel
#

Hi there, taking over for @brittle osprey as they had to step away

#

Looking over the context of the thread now

#

Okay, from what I can tell, both requests you shared were to create a new Subscription. That API endpoint will fail if the default_payment_method isn't found on the Customer.

You could not specify the default_payment_method, which will then use the Customer's invoice_settings.default_payment_method
https://docs.stripe.com/api/subscriptions/create#create_subscription-default_payment_method

If neither are set, invoices will use the customer’s invoice_settings.default_payment_method or default_source.

But this request will still fail if the Customer does not have a payment method set this way. So in the end, you'll need to figure out why the Customer's payment method is being detached. Before making the create Subscription request, you could retrieve the payment methods for that Customer to make sure the one you specify exists on the customer (which can at least let you know if the request will be able to succeed)
https://docs.stripe.com/api/payment_methods/customer

sturdy field
#

I understand, and would it be a problem if I restore the payment method if it has already been deleted previously?

#

When doing this:

payment_methods = stripe.Customer.list_payment_methods(
“cus_9s6XKzkNRiz8i3”,
limit=3,)

Would it also return payment methods that have been deleted either by the customer or someone on my team from the dashboard?

misty laurel
#

No, and unfortunately you can't re-attach a payment method once it's been detached

sturdy field
#

And doing this:

stripe.billing_portal.Configuration.create(
features={
"payment_method_update": {
"enabled": True,
}
}

doesn't this give the customer a default payment method? I ask because that's how it currently works, and when you enter the customer in the dashboard, their (new) default payment method appears.

#

this page

misty laurel
#

I don't think that's relevant to the main point - if the customer has the ability to detach their payment method, then you will run into this issue where the create subscription request will fail