Customers
Zahlungsmethode löschen
Löschen Sie eine mit einem Kunden verknüpfte Zahlungsmethode.
DELETE
/
customers
/
{customer_id}
/
payment-methods
/
{payment_method_id}
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
await client.customers.deletePaymentMethod('payment_method_id', {
customer_id: 'cus_TV52uJWWXt2yIoBBxpjaa',
});import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
client.customers.delete_payment_method(
payment_method_id="payment_method_id",
customer_id="cus_TV52uJWWXt2yIoBBxpjaa",
)package main
import (
"context"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
err := client.Customers.DeletePaymentMethod(
context.TODO(),
"cus_TV52uJWWXt2yIoBBxpjaa",
"payment_method_id",
)
if err != nil {
panic(err.Error())
}
}package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.customers.CustomerDeletePaymentMethodParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
CustomerDeletePaymentMethodParams params = CustomerDeletePaymentMethodParams.builder()
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.paymentMethodId("payment_method_id")
.build();
client.customers().deletePaymentMethod(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.customers.CustomerDeletePaymentMethodParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: CustomerDeletePaymentMethodParams = CustomerDeletePaymentMethodParams.builder()
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.paymentMethodId("payment_method_id")
.build()
client.customers().deletePaymentMethod(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
result = dodo_payments.customers.delete_payment_method(
"payment_method_id",
customer_id: "cus_TV52uJWWXt2yIoBBxpjaa"
)
puts(result)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$result = $client->customers->deletePaymentMethod(
'payment_method_id', customerID: 'cus_TV52uJWWXt2yIoBBxpjaa'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using DodoPayments.Client;
using DodoPayments.Client.Models.Customers;
DodoPaymentsClient client = new();
CustomerDeletePaymentMethodParams parameters = new()
{
CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa",
PaymentMethodID = "payment_method_id",
};
await client.Customers.DeletePaymentMethod(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let customer_id = "customer_id";
let payment_method_id = "payment_method_id";
let result = client
.customers()
.delete_payment_method()
.customer_id(customer_id)
.payment_method_id(payment_method_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request DELETE \
--url https://test.dodopayments.com/customers/{customer_id}/payment-methods/{payment_method_id} \
--header 'Authorization: Bearer <token>'Entfernen Sie eine gespeicherte Zahlungsmethode aus dem Konto eines Kunden. Verwenden Sie dies, um veraltete oder unerwünschte Zahlungsmethoden zu bereinigen.
Wenn die gelöschte Zahlungsmethode die einzige im System für ein aktives Abonnement ist, kann es sein, dass das Abonnement im nächsten Abrechnungszyklus nicht erneuert wird. Stellen Sie sicher, dass der Kunde eine alternative Zahlungsmethode hat, bevor Sie diese löschen.
Anwendungsfälle
- Kundenanfrage: Entfernen Sie eine Zahlungsmethode, die der Kunde nicht mehr im System haben möchte
- Abgelaufene Karten: Bereinigen Sie Zahlungsmethoden mit abgelaufenen Kartendaten
- Sicherheit: Entfernen Sie kompromittierte Zahlungsmethoden sofort
Zuletzt geändert am 20. April 2026
War diese Seite hilfreich?
Zurück
Kunden-Wallets abrufenAbrufen der Guthaben von Geldbörsen, die einem bestimmten Kunden zugeordnet sind. Wallets enthalten echtes Geld (USD, INR), das zur Begleichung von Rechnungen und Abonnementszahlungen verwendet werden kann.
Weiter
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
await client.customers.deletePaymentMethod('payment_method_id', {
customer_id: 'cus_TV52uJWWXt2yIoBBxpjaa',
});import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
client.customers.delete_payment_method(
payment_method_id="payment_method_id",
customer_id="cus_TV52uJWWXt2yIoBBxpjaa",
)package main
import (
"context"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
err := client.Customers.DeletePaymentMethod(
context.TODO(),
"cus_TV52uJWWXt2yIoBBxpjaa",
"payment_method_id",
)
if err != nil {
panic(err.Error())
}
}package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.customers.CustomerDeletePaymentMethodParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
CustomerDeletePaymentMethodParams params = CustomerDeletePaymentMethodParams.builder()
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.paymentMethodId("payment_method_id")
.build();
client.customers().deletePaymentMethod(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.customers.CustomerDeletePaymentMethodParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: CustomerDeletePaymentMethodParams = CustomerDeletePaymentMethodParams.builder()
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.paymentMethodId("payment_method_id")
.build()
client.customers().deletePaymentMethod(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
result = dodo_payments.customers.delete_payment_method(
"payment_method_id",
customer_id: "cus_TV52uJWWXt2yIoBBxpjaa"
)
puts(result)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$result = $client->customers->deletePaymentMethod(
'payment_method_id', customerID: 'cus_TV52uJWWXt2yIoBBxpjaa'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using DodoPayments.Client;
using DodoPayments.Client.Models.Customers;
DodoPaymentsClient client = new();
CustomerDeletePaymentMethodParams parameters = new()
{
CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa",
PaymentMethodID = "payment_method_id",
};
await client.Customers.DeletePaymentMethod(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let customer_id = "customer_id";
let payment_method_id = "payment_method_id";
let result = client
.customers()
.delete_payment_method()
.customer_id(customer_id)
.payment_method_id(payment_method_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request DELETE \
--url https://test.dodopayments.com/customers/{customer_id}/payment-methods/{payment_method_id} \
--header 'Authorization: Bearer <token>'