Stripe PaymentMethod Detached from Customer
Root cause
The Stripe PaymentMethod object that was stored for recurring billing has been detached from the Stripe Customer object — either by an explicit API call to /v1/payment_methods/{id}/detach, a customer self-service action in a Stripe-hosted portal, or an automated cleanup script that removed inactive payment methods.
Symptoms
- • Stripe returns an error indicating the PaymentMethod is not attached to the customer
- • The Stripe PaymentMethod ID stored in your system returns a detached status when queried
- • Recharge billing attempts fail with a payment method error before reaching the card network
- • The Stripe Customer record shows no active payment methods in the Dashboard
How to fix it
Confirm the PaymentMethod detachment in Stripe
Query the Stripe PaymentMethod via GET /v1/payment_methods/{id}. A detached PaymentMethod returns customer: null. Also check the Stripe Customer's payment methods via GET /v1/customers/{customer_id}/payment_methods to confirm no active methods remain. This distinguishes a detached method (resolvable by re-attaching or adding a new one) from a deleted method (requires a completely new method).
Open in admin →Re-attach the PaymentMethod if it still exists
If the PaymentMethod was only detached (not deleted), re-attach it: POST /v1/payment_methods/{id}/attach with body {customer: customer_id}. Then set it as the default: POST /v1/customers/{customer_id} with {invoice_settings: {default_payment_method: method_id}}. After re-attaching, update the Shopify subscription contract's customerPaymentMethodId and retry billing.
Audit payment method cleanup scripts for subscription customers
If the detachment was caused by an automated cleanup script (removing old or unused payment methods), add a check: before detaching any PaymentMethod, verify it is not referenced by any active Stripe Subscription or used in any Shopify subscriptionContract. Never run bulk payment method cleanup without this guard — it will break billing for any subscription using that method.
Frequently asked questions
What is the difference between a detached and a deleted PaymentMethod in Stripe?
A detached PaymentMethod still exists in Stripe but is no longer associated with a customer — it can be re-attached to the same or a different customer. A deleted PaymentMethod no longer exists and cannot be recovered. Check the PaymentMethod object: detached returns customer: null, deleted returns a 404 from the API. Only detached methods can be re-attached.
Can a Stripe Billing Customer Portal detach payment methods used for subscriptions?
Yes — if you enable the Customer Portal with permission to manage payment methods, customers can remove cards used for subscriptions. Before enabling this permission, configure Stripe to require at least one payment method to remain attached if the customer has active subscriptions. In Stripe Dashboard, go to Settings > Customer Portal and review the payment method permissions.
Detect this error automatically
Free cross-stack scan finds all billing errors in 60 seconds.
Run Free Scan →