---
title: "Update a payment method"
method: PATCH
path: "/payment-methods/{paymentMethodId}"
tags: ["Payment Methods"]
---

# Update a payment method

`PATCH /payment-methods/{paymentMethodId}`

## Request

- Base URL: `https://api.sandbox.nevermined.app/api/v1`
- URL: `https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}`
- Auth: HTTP bearer

Updates a saved payment method, changing its friendly alias and/or the set of NVM API keys allowed to use it. Requires a Nevermined API key.

## Path parameters

- `paymentMethodId` string, required

## Request body

- UpdatePaymentMethodDto
  - `alias` string: Optional friendly name for the card
  - `allowedApiKeyIds` string[], nullable: Array of NVM API Key skId values allowed to use this card. Null or empty = any key can use it.
  - `orgId` string, nullable: Move the card to an org (a valid orgId) or to personal (null). Omit to leave unchanged.

## Response `200`

The updated payment method

- PaymentMethodSummaryDto
  - `id` string, required
  - `type` string, required
  - `last4` string, required
  - `brand` string, required
  - `expMonth` integer, nullable, required
  - `expYear` integer, nullable, required
  - `alias` string, nullable, required
  - `provider` 'stripe' | 'braintree' | 'erc4337' | 'visa' | 'vgs', required
  - `status` 'Active' | 'Revoked', required
  - `allowedApiKeyIds` string[], nullable: NVM API Key IDs allowed to use this card. Null = any key can use it.
  - `orgId` string, nullable: Organization this card belongs to (null = personal).

## Other responses

- `401`: Unauthorized - Invalid or missing API key
- `404`: Not Found - Payment method does not exist

---

[API](https://skmtc.dev/nevermined/apis/nevermined-api.md) · [All operations](https://skmtc.dev/nevermined/apis/nevermined-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nevermined/apis/nevermined-api/revisions/cabbe618c80b?raw)
