Customers
Zahlungsmethoden auflisten
Listet alle Zahlungsmethoden auf, die mit einem bestimmten Kunden verbunden sind.
GET
/
customers
/
{customer_id}
/
payment-methods
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const response = await client.customers.retrievePaymentMethods('cus_TV52uJWWXt2yIoBBxpjaa');
console.log(response.items);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
)
response = client.customers.retrieve_payment_methods(
"cus_TV52uJWWXt2yIoBBxpjaa",
)
print(response.items)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.Customers.GetPaymentMethods(context.TODO(), "cus_TV52uJWWXt2yIoBBxpjaa")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Items)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsParams;
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
CustomerRetrievePaymentMethodsResponse response = client.customers().retrievePaymentMethods("cus_TV52uJWWXt2yIoBBxpjaa");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsParams
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val response: CustomerRetrievePaymentMethodsResponse = client.customers().retrievePaymentMethods("cus_TV52uJWWXt2yIoBBxpjaa")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
response = dodo_payments.customers.retrieve_payment_methods("cus_TV52uJWWXt2yIoBBxpjaa")
puts(response)<?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 {
$response = $client->customers->retrievePaymentMethods(
'cus_TV52uJWWXt2yIoBBxpjaa'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Customers;
DodoPaymentsClient client = new();
CustomerRetrievePaymentMethodsParams parameters = new()
{
CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa"
};
var response = await client.Customers.RetrievePaymentMethods(parameters);
Console.WriteLine(response);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let customer_id = "customer_id";
let result = client
.customers()
.retrieve_payment_methods()
.customer_id(customer_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/customers/{customer_id}/payment-methods \
--header 'Authorization: Bearer <token>'{
"items": [
{
"payment_method": "card",
"payment_method_id": "<string>",
"card": {
"card_holder_name": "<string>",
"card_issuing_country": "AF",
"card_network": "<string>",
"card_type": "<string>",
"expiry_month": "<string>",
"expiry_year": "<string>",
"last4_digits": "<string>"
},
"last_used_at": "2023-11-07T05:31:56Z",
"payment_method_type": "ach",
"recurring_enabled": true
}
]
}Autorisierungen
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.
Pfadparameter
Customer Id
Antwort
Show child attributes
Show child attributes
Zuletzt geändert am 1. April 2026
War diese Seite hilfreich?
⌘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
});
const response = await client.customers.retrievePaymentMethods('cus_TV52uJWWXt2yIoBBxpjaa');
console.log(response.items);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
)
response = client.customers.retrieve_payment_methods(
"cus_TV52uJWWXt2yIoBBxpjaa",
)
print(response.items)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.Customers.GetPaymentMethods(context.TODO(), "cus_TV52uJWWXt2yIoBBxpjaa")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Items)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsParams;
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
CustomerRetrievePaymentMethodsResponse response = client.customers().retrievePaymentMethods("cus_TV52uJWWXt2yIoBBxpjaa");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsParams
import com.dodopayments.api.models.customers.CustomerRetrievePaymentMethodsResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val response: CustomerRetrievePaymentMethodsResponse = client.customers().retrievePaymentMethods("cus_TV52uJWWXt2yIoBBxpjaa")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
response = dodo_payments.customers.retrieve_payment_methods("cus_TV52uJWWXt2yIoBBxpjaa")
puts(response)<?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 {
$response = $client->customers->retrievePaymentMethods(
'cus_TV52uJWWXt2yIoBBxpjaa'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Customers;
DodoPaymentsClient client = new();
CustomerRetrievePaymentMethodsParams parameters = new()
{
CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa"
};
var response = await client.Customers.RetrievePaymentMethods(parameters);
Console.WriteLine(response);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let customer_id = "customer_id";
let result = client
.customers()
.retrieve_payment_methods()
.customer_id(customer_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/customers/{customer_id}/payment-methods \
--header 'Authorization: Bearer <token>'{
"items": [
{
"payment_method": "card",
"payment_method_id": "<string>",
"card": {
"card_holder_name": "<string>",
"card_issuing_country": "AF",
"card_network": "<string>",
"card_type": "<string>",
"expiry_month": "<string>",
"expiry_year": "<string>",
"last4_digits": "<string>"
},
"last_used_at": "2023-11-07T05:31:56Z",
"payment_method_type": "ach",
"recurring_enabled": true
}
]
}