cURL
curl --request GET \
--url https://api.tirdad.ai/v1/customers/{id}/payment-methods \
--header 'x-api-key: <api-key>'from tirdad_sdk import Tirdad
with Tirdad(
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 { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.customers.listCustomerPaymentMethods("<id>");
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.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://api.tirdad.ai/v1/customers/{id}/payment-methods \
--header 'x-api-key: <api-key>'from tirdad_sdk import Tirdad
with Tirdad(
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 { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.customers.listCustomerPaymentMethods("<id>");
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.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>"
}