Hapus metode pembayaran yang terkait dengan pelanggan.
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",
)
Hapus metode pembayaran yang disimpan dari akun pelanggan. Gunakan ini untuk membersihkan metode pembayaran yang usang atau tidak diinginkan.
Anda tidak dapat menghapus metode pembayaran yang sedang digunakan oleh langganan aktif. API mengembalikan 409 Conflict dengan Payment method is in use by an active subscription. Pindahkan langganan ke metode pembayaran lain terlebih dahulu menggunakan Perbarui Metode Pembayaran, lalu hapus metode pembayaran yang lama.
Penghapusan yang berhasil mengembalikan 204 No Content.
Kasus Penggunaan
Permintaan pelanggan: Hapus metode pembayaran yang tidak lagi ingin disimpan oleh pelanggan
Kartu kedaluwarsa: Bersihkan metode pembayaran dengan detail kartu yang telah kedaluwarsa
Keamanan: Segera hapus metode pembayaran yang telah disusupi
Otorisasi
Authorization
string
header
wajib
Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.
Parameter Path
customer_id
string
wajib
Customer Id
payment_method_id
string
wajib
Payment Method Id
Respons
Payment method deleted successfully
Terakhir diubah pada 6 Agustus 2026
Apakah halaman ini membantu?
⌘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",
)