> This page is for API Reference.

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

# Delete payment method

DELETE https://api.npretail.app/{tenant}/{environment}/{company}/membership/paymentmethods/{paymentMethodId}

Delete an existing payment method using the payment method ID.

Reference: https://docs.navipartner.com/apis/api-reference/memberships/service-paymentmethod/delete-payment-method

## Authentication

- `x-np-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `tenant` (string, required) — Your Entra Tenant ID. [More details.](/paths#1-tenant)
- `environment` (string, required) — Your Business Central Environment. [More details.](/paths#2-environment)
- `company` (string, required) — Your Business Central Company. [More details.](/paths#3-company)
- `paymentMethodId` (UUID, required) — Unique identifier for a payment method.

## Response

### 200

- `paymentMethod` (PaymentMethodRetrieveDTO, required) — The PaymentMethodRetrieveDTO extends the PaymentMethodDTO and includes additional property - the payment method ID. This DTO is used when retrieving infromation about existing payment methods.

## Types

### PaymentMethodRetrieveDTO

The PaymentMethodRetrieveDTO extends the PaymentMethodDTO and includes additional property - the payment method ID. This DTO is used when retrieving infromation about existing payment methods.

- `accountId` (UUID, required)
- `id` (UUID, required) — Unique identifier for a payment method.
- `PANLastDigits` (string, optional) — The last 4 digits of the payment card number.
- `PSP` (enum, optional) — The payment service provider of the payment method.
  - Allowed values: `Adyen`, `Vipps`
- `alias` (string, optional) — A short description that can be assigned to each payment method by the end user.
- `default` (boolean, optional) — Indicates whether the payment method should be set up as default.
- `expiryDate` (date, optional) — The expiry date of the card.
- `maskedPAN` (string, optional) — The masked PAN of the card. The exact structure depends on the PSP.
- `paymentBrand` (string, optional) — The payment method brand.
- `paymentInstrument` (string, optional) — The payment method type.
- `status` (enum, optional) — The status of the payment method.
  - Allowed values: `Active`, `Archived`

## Examples

**Response**

```json
{
  "paymentMethod": {
    "accountId": "e2cfea9f-385e-4d83-8b50-42256885b03a",
    "id": "a7b41af8-d187-48d9-89e0-a57c47039004",
    "PANLastDigits": "1234",
    "PSP": "Adyen",
    "alias": "my main card",
    "default": true,
    "expiryDate": "2029-09-30",
    "maskedPAN": "541333 **** 1234",
    "paymentBrand": "visa",
    "paymentInstrument": "Card",
    "status": "Active"
  }
}
```

**SDK Code**

```python ExamplePaymentMethod
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004"

headers = {"x-np-api-key": "<NaviPartner API Key>"}

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

print(response.json())
```

```javascript ExamplePaymentMethod
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004';
const options = {method: 'DELETE', headers: {'x-np-api-key': '<NaviPartner API Key>'}};

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

```go ExamplePaymentMethod
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004"

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")

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

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

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

}
```

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

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004")

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

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

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

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

HttpResponse<String> response = Unirest.delete("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004', [
  'headers' => [
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp ExamplePaymentMethod
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004");
var request = new RestRequest(Method.DELETE);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
IRestResponse response = client.Execute(request);
```

```swift ExamplePaymentMethod
import Foundation

let headers = ["x-np-api-key": "<NaviPartner API Key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/paymentmethods/a7b41af8-d187-48d9-89e0-a57c47039004")! 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()
```