> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).
>
> To search these docs, send a `GET` request to `https://paddle-docs-retrieval.kapa-paddle.workers.dev/?q=<question>` with a URL-encoded question. No authentication needed. It returns a JSON array of `{content, source_url}`, most relevant first.

# Payment method can't be deleted while in use on a subscription

You can't delete a payment method while a subscription that isn't `canceled` still uses it.

---

## Example

```json
{
  "error": {
    "type": "request_error",
    "code": "payment_method_in_use",
    "detail": "Can't delete a payment method that's in use on an active, trialing, paused, or past_due subscription.",
    "documentation_url": "https://developer.paddle.com/errors/payment_methods/payment_method_in_use"
  },
  "meta": {
    "request_id": "00000000-0000-0000-0000-000000000000"
  }
}
```

## Details

| Attribute | Value |
| --- | --- |
| Status code | 400 |
| Error code | `payment_method_in_use` |
| Error message | Can't delete a payment method that's in use on an active, trialing, paused, or past_due subscription. |

## Common causes

- A payment attempt on the most recent `completed` transaction for at least one of the customer's `active`, `trialing`, `paused`, or `past_due` subscriptions used this payment method. Subscriptions that are `canceled` don't block deletion.

## Common solutions

- [List subscriptions](https://developer.paddle.com/api-reference/subscriptions/list-subscriptions) for this customer, filtering by `customer_id` and `status=active,trialing,paused,past_due`. For each subscription, [list transactions](https://developer.paddle.com/api-reference/transactions/list-transactions) with `subscription_id`, `status=completed`, `order_by=updated_at[DESC]`, and `per_page=1`. The subscription uses this payment method if any entry in that transaction's `payments` array has a matching `payment_method_id`.
- Update the payment method on each of those subscriptions, then retry the delete. [Get a transaction to update payment method](https://developer.paddle.com/api-reference/subscriptions/update-payment-method) and pass it to Paddle.js, or [create a customer portal session](https://developer.paddle.com/api-reference/customer-portals/create-customer-portal-session) so the customer can update it.
