> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# deleteVaultedPaymentMethod

Delete a vaulted payment method for the `customerId` attached to the [client session](/docs/api-reference/v2.4/api-reference/client-session-api/create-a-client-session#body-customer-id) by id.
You can get the id from any instance of `VaultedPaymentMethod` returned by [fetchVaultedPaymentMethods](/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods).

```typescript TYPESCRIPT theme={"dark"}
    async deleteVaultedPaymentMethod(vaultedPaymentMethodId: string): Promise<void>
```

## Parameters

<Expandable title="Parameters" defaultOpen>
  <ResponseField name="vaultedPaymentMethodId" type="String" required>
    The `id` of `VaultedPaymentMethod` previously retrieved with [fetchVaultedPaymentMethods](/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods).
  </ResponseField>
</Expandable>

## Returns

The `deleteVaultedPaymentMethod` method performs the deletion of the vaulted payment method and returns a Promise of `void`.

## Example

The `VaultManager` needs to be configured before `deleteVaultedPaymentMethod` can be called.
Refer to the following example for [configuring](/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/configure) the `VaultManager`.

```typescript TYPESCRIPT theme={"dark"}
async function handleDeletePaymentMethod() {
  try {
    //Ensure the Vault Manager has been configured
    await vaultManager.deleteVaultedPaymentMethod("yourVaultedPaymentMethodId");
    console.log("Payment method deleted successfully");
  } catch (error) {
    console.error("Error deleting payment method:", error);
  }
}
```
