> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.useroot.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.useroot.com/_mcp/server.

# Delete payment method

DELETE https://api.useroot.com/api/payees/{payee_id}/payment-methods/{payment_method_id}

Deletes a payment method. You cannot delete the default payment method — set another as default first.

**Path Parameters**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `payee_id` | UUID | Yes | ID of the payee |
| `payment_method_id` | UUID | Yes | ID of the payment method to delete |

- You cannot delete a payment method that is currently set as **default**. Set a different verified payment method as default first.

**Response**

204 No Content – The payment method was successfully deleted.

**Success Responses**

| Status Code | Description |
|-------------|-------------|
| 204 | No Content – The payment method was successfully deleted. |

**Error Responses**

| Status Code | Error Code | Description |
|-------------|------------|-------------|
| 400 | DEFAULT_PAYMENT_METHOD | Cannot delete the default payment method. Set another payment method as default first. |
| 401 | AUTHENTICATION_ERROR | Authentication credentials are invalid or missing. |
| 403 | AUTHORIZATION_ERROR | You do not have permission to perform this action. |
| 404 | NOT_FOUND | The specified payment method was not found. |

Reference: https://docs.useroot.com/api-reference/payment-methods-api/payee-payment-methods-api/delete-payee-payment-method

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/payees/{payee_id}/payment-methods/{payment_method_id}:
    delete:
      operationId: delete-payee-payment-method
      summary: Delete payment method
      description: >-
        Deletes a payment method. You cannot delete the default payment method —
        set another as default first.


        **Path Parameters**


        | Parameter | Type | Required | Description |

        |-----------|------|----------|-------------|

        | `payee_id` | UUID | Yes | ID of the payee |

        | `payment_method_id` | UUID | Yes | ID of the payment method to delete
        |


        - You cannot delete a payment method that is currently set as
        **default**. Set a different verified payment method as default first.


        **Response**


        204 No Content – The payment method was successfully deleted.


        **Success Responses**


        | Status Code | Description |

        |-------------|-------------|

        | 204 | No Content – The payment method was successfully deleted. |


        **Error Responses**


        | Status Code | Error Code | Description |

        |-------------|------------|-------------|

        | 400 | DEFAULT_PAYMENT_METHOD | Cannot delete the default payment
        method. Set another payment method as default first. |

        | 401 | AUTHENTICATION_ERROR | Authentication credentials are invalid or
        missing. |

        | 403 | AUTHORIZATION_ERROR | You do not have permission to perform this
        action. |

        | 404 | NOT_FOUND | The specified payment method was not found. |
      tags:
        - payeePaymentMethodsApi
      parameters:
        - name: payee_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: payment_method_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Payment method deleted successfully (no content)
          content:
            application/json:
              schema:
                type: object
                properties: {}
servers:
  - url: https://api.useroot.com
    description: Production
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## Examples



**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id"

headers = {"x-api-key": "<apiKey>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id';
const options = {method: 'DELETE', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payees/payee_id/payment-methods/payment_method_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```