Skip to content

Remove a payment method

The portal.payment_methods.delete operation: DELETE /api/v1/portal/me/payment_methods/{paymentMethodId} in the REST API and the portal_payment_methods_delete tool in the MCP server.

DELETE/api/v1/portal/me/payment_methods/{paymentMethodId}

Removes one of the signed-in customer's saved payment methods: it is never charged again and stops being the default (subscriptions then charge the new default, if any). The processor detaches it too, right after. The record stays for the history of the payments made with it. Customer portal only (portal:write).

At a glance

  • REST: DELETE /api/v1/portal/me/payment_methods/{paymentMethodId}
  • MCP tool: portal_payment_methods_delete
  • Operation ID: portal.payment_methods.delete
  • Scope: Brand
  • Permission: portal:write
  • Risk tier: write
  • Dry run: Not supported
  • Idempotency: Idempotency-Key optional
  • Modes: Test and live
  • Authentication: A customer signed in to the customer portal (API keys can't call it)
  • Since: M9

Request

Path parameters

FieldTypeDescription
paymentMethodIdpm_… IDOne of your saved payment methods (pm_…).

Body

This operation takes no body.

Response

200 OK with a JSON object:

FieldTypeDescription
idpm_… ID
object"portal_payment_method"
typestring
cardobject or null
isDefaultboolean
createdAtdate-time

Examples

Remove an old card

HTTP
DELETE /api/v1/portal/me/payment_methods/pm_01m4tx5nj8emwbyf7y9vcf48b6
Authorization: Bearer or_test_…

Response (200):

JSON
{
  "id": "pm_01m4tx5nj8emwbyf7y9vcf48b6",
  "object": "portal_payment_method",
  "type": "card",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "expMonth": 12,
    "expYear": 2029,
    "country": "DE"
  },
  "isDefault": false,
  "createdAt": "2026-10-20T09:00:00.000Z"
}

Errors

CodeHTTP statusWhenWhat to do
validation_failed400The payment method's ID or another field is malformed.Fix the fields listed in details.issues and send the request again.
resource_not_found404You have no such payment method (another customer's reads the same).Check the ID and that your credentials are scoped to the right organization, entity, brand and mode.
version_conflict409Your payment methods changed at the same moment; retry.Fetch the object again and retry the change.
livemode_not_allowed403The portal session is in the other mode than the request.Use test mode, or credentials for the target's mode. Developers need live access granted by an organization owner or admin.
permission_denied403The caller isn't a customer signed in to this brand's portal (operators and API keys use the customer operations).Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, scope_required, idempotency_key_reused, idempotency_in_progress, dry_run_not_supported, rate_limited, internal_error.