cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/customers/{id}/payment-methods \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.list_customer_payment_methods(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.customers.listCustomerPaymentMethods("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.ListCustomerPaymentMethods(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.SavedPaymentMethodsResponse != nil {
// handle response
}
}{
"providers": [
{
"error": {
"message": "<string>"
},
"items": [
{
"can_auto_charge": true,
"card": {
"brand": "<string>",
"exp_month": 123,
"exp_year": 123,
"last4": "<string>"
},
"id": "<string>",
"instantly_chargeable": true,
"is_default": true,
"provider": "stripe",
"recurring": {
"auto_chargeable_till": "<string>",
"max_amount": "<string>",
"status": "PENDING"
},
"status": "ACTIVE",
"type": "CARD",
"upi": {
"vpa": "<string>"
}
}
],
"provider": "stripe"
}
]
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Customers
List customer payment methods
Use when you need a customer’s saved payment methods across every connected gateway, including whether each can be auto-charged. Only gateways that can list saved methods are included.
GET
/
customers
/
{id}
/
payment-methods
cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/customers/{id}/payment-methods \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.list_customer_payment_methods(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.customers.listCustomerPaymentMethods("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.ListCustomerPaymentMethods(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.SavedPaymentMethodsResponse != nil {
// handle response
}
}{
"providers": [
{
"error": {
"message": "<string>"
},
"items": [
{
"can_auto_charge": true,
"card": {
"brand": "<string>",
"exp_month": 123,
"exp_year": 123,
"last4": "<string>"
},
"id": "<string>",
"instantly_chargeable": true,
"is_default": true,
"provider": "stripe",
"recurring": {
"auto_chargeable_till": "<string>",
"max_amount": "<string>",
"status": "PENDING"
},
"status": "ACTIVE",
"type": "CARD",
"upi": {
"vpa": "<string>"
}
}
],
"provider": "stripe"
}
]
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}
