# payment_method.detached: check whether the default just left

A payment method was detached from a customer. The urgent question is whether anything was pointing at it.

## What to do on receipt

1. Read `data.object.id` and compare it against the customer's `invoice_settings.default_payment_method` and each active subscription's `default_payment_method`. If it matches any of them, the customer now has no working default.
2. If the default left: email the customer promptly to add a new one, and flag the account. The next invoice will fail with no payment method, which is the most avoidable kind of churn there is.
3. If it was not the default, just log it. A customer tidying their wallet is not an emergency.
4. Return 200.

## The trap

Silence. Detach events look boring, so nobody handles them, and the failure surfaces weeks later as `invoice.payment_failed` with "no payment method," by which time the customer has no idea why. Catching it at detach time turns a failed renewal into a two-minute fix.

## Checklist

- Detach can come from the customer via the portal or from your own code. Either way, the default check is the same.
- Do not auto-attach a replacement or pick another method as the default unprompted. Choosing which card gets charged is the customer's decision.