# Detach a payment method

> The payment_methods.delete operation: DELETE /api/v1/payment_methods/{id} in the REST API and the payment_methods_delete tool in the MCP server.

Detaches a saved payment method: it is never charged again and stops being the default (subscriptions then
charge the customer's new default, if any). It stays readable with `detachedAt`; the processor detaches it
too, right after. Detaching a detached method changes nothing. Emits `payment_method.detached`.

## At a glance

- **REST:** `DELETE /api/v1/payment_methods/{id}`
- **MCP tool:** `payment_methods_delete`
- **Operation ID:** `payment_methods.delete`
- **Scope:** Brand
- **Permission:** `customers:write`
- **Risk tier:** `write`
- **Dry run:** Supported (send `Ownrecord-Dry-Run: true`)
- **Idempotency:** `Idempotency-Key` optional
- **Modes:** Test and live
- **Authentication:** API key with the `customers:write` scope
- **Since:** M5

## Request

### Path parameters

| Field | Type      | Description |
| ----- | --------- | ----------- |
| `id`  | `pm_…` ID |             |

### Body

This operation takes no body.

## Response

`200 OK` with a JSON object:

| Field                          | Type                              | Description                                                        |
| ------------------------------ | --------------------------------- | ------------------------------------------------------------------ |
| `id`                           | `pm_…` ID                         |                                                                    |
| `object`                       | `"payment_method"`                |                                                                    |
| `livemode`                     | boolean                           |                                                                    |
| `brandId`                      | `brd_…` ID                        |                                                                    |
| `customerId`                   | `cus_…` ID                        |                                                                    |
| `processor`                    | one of `stripe`, `mollie`, `fake` |                                                                    |
| `processorConnectionId`        | `pcon_…` ID                       |                                                                    |
| `processorRef`                 | object                            |                                                                    |
| `processorRef.paymentMethodId` | string                            | The processor's ID of the method (Stripe `pm_…`).                  |
| `type`                         | string                            | `card`, `sepa_debit`, … as the processor reports it.               |
| `card`                         | object or null                    |                                                                    |
| `isDefault`                    | boolean                           | Charged for the customer's subscriptions unless one names another. |
| `source`                       | one of `checkout`, `setup`        |                                                                    |
| `createdAt`                    | date-time                         |                                                                    |
| `detachedAt`                   | date-time or null                 |                                                                    |

## Examples

### Remove an old card

```http
DELETE /api/v1/payment_methods/pm_01m4tx5nj8emwbyf7y9vcf47zd
Authorization: Bearer or_test_…
```

Response (`200`):

```json
{
  "id": "pm_01m4tx5nj8emwbyf7y9vcf47zd",
  "object": "payment_method",
  "livemode": false,
  "brandId": "brd_01m4tx5nj8emwbyf7y9vcf47x4",
  "customerId": "cus_01m4tx5nj8emwbyf7y9vcf47z4",
  "processor": "stripe",
  "processorConnectionId": "pcon_01m4tx5nj8emwbyf7y9vcf47zf",
  "processorRef": {
    "paymentMethodId": "pm_1QExampleCard"
  },
  "type": "card",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "expMonth": 12,
    "expYear": 2029,
    "country": "DE"
  },
  "isDefault": false,
  "source": "checkout",
  "createdAt": "2026-10-13T12:00:00.000Z",
  "detachedAt": "2026-10-20T09:00:00.000Z"
}
```

## Errors

| Code                                                                                     | HTTP status | When                                                         | What to do                                                                                           |
| ---------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| [`resource_not_found`](https://ownrecord.io/docs/reference/errors.md#resource_not_found) | 404         | No payment method with this ID is visible to the request.    | Check the ID and that your credentials are scoped to the right organization, entity, brand and mode. |
| [`version_conflict`](https://ownrecord.io/docs/reference/errors.md#version_conflict)     | 409         | The customer's methods changed at the same time; retry.      | Fetch the object again and retry the change.                                                         |
| [`permission_denied`](https://ownrecord.io/docs/reference/errors.md#permission_denied)   | 403         | You can't change this brand's customers (`customers:write`). | Ask an organization owner or admin for a role or scope that allows this action.                      |

It can also return these [common errors](https://ownrecord.io/docs/reference.md#common-errors): [`validation_failed`](https://ownrecord.io/docs/reference/errors.md#validation_failed), [`api_version_unsupported`](https://ownrecord.io/docs/reference/errors.md#api_version_unsupported), [`invalid_json`](https://ownrecord.io/docs/reference/errors.md#invalid_json), [`unsupported_media_type`](https://ownrecord.io/docs/reference/errors.md#unsupported_media_type), [`authentication_required`](https://ownrecord.io/docs/reference/errors.md#authentication_required), [`api_key_invalid`](https://ownrecord.io/docs/reference/errors.md#api_key_invalid), [`scope_required`](https://ownrecord.io/docs/reference/errors.md#scope_required), [`idempotency_key_reused`](https://ownrecord.io/docs/reference/errors.md#idempotency_key_reused), [`idempotency_in_progress`](https://ownrecord.io/docs/reference/errors.md#idempotency_in_progress), [`approval_required`](https://ownrecord.io/docs/reference/errors.md#approval_required), [`approval_rejected`](https://ownrecord.io/docs/reference/errors.md#approval_rejected), [`approval_expired`](https://ownrecord.io/docs/reference/errors.md#approval_expired), [`stale_approval`](https://ownrecord.io/docs/reference/errors.md#stale_approval), [`approval_policy_denied`](https://ownrecord.io/docs/reference/errors.md#approval_policy_denied), [`rate_limited`](https://ownrecord.io/docs/reference/errors.md#rate_limited), [`internal_error`](https://ownrecord.io/docs/reference/errors.md#internal_error).
