List payment methods for a Customer
Retrieve a customer's saved payment methods.
HTTP request
GET https://sandbox.hyperswitch.io/customers/{customer_id}/payment_methods
Example — cURL
curl --request GET \
--url https://sandbox.hyperswitch.io/customers/{customer_id}/payment_methods \
--header 'api-key: <api-key>'Success response (200)
{
"customer_payment_methods": [
{
"payment_token": "7ebf443f-a050-4067-84e5-e6f6d4800aef",
"payment_method_id": "pm_iouuy468iyuowqs",
"customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"payment_method": "card",
"requires_cvv": true,
"default_payment_method_set": true,
"payment_method_type": "ach",
"payment_method_issuer": "Citibank",
"payment_method_issuer_code": "jp_hdfc",
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": [
"redirect_to_url"
],
"card": {
"saved_to_locker": true,
"scheme": "<string>",
"issuer_country": "<string>",
"issuer_country_code": "<string>",
"last4_digits": "<string>",
"expiry_month": "<string>",
"expiry_year": "<string>",
"card_token": "<string>",
"card_holder_name": "<string>",
"card_fingerprint": "<string>",
"nick_name": "<string>",
"card_network": "Visa",
"card_isin": "<string>",
"card_issuer": "<string>",
"card_type": "<string>"
},
"metadata": {},
"created": "2023-01-18T11:04:09.922Z",
"bank_transfer": {
"bank_account_number": "000123456",
"bank_routing_number": "110000000",
"bank_name": "Deutsche Bank",
"bank_country_code": "AF",
"bank_city": "California"
},
"bank": {
"mask": "<string>"
},
"surcharge_details": {
"surcharge": {
"type": "fixed",
"value": 123
},
"display_surcharge_amount": 123,
"display_tax_on_surcharge_amount": 123,
"display_total_surcharge_amount": 123,
"tax_on_surcharge": {
"percentage": 123
}
},
"last_used_at": "2024-02-24T11:04:09.922Z",
"billing": {
"address": {
"city": "New York",
"country": "AF",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
}
],
"is_guest_customer": true
}Authorization
Header:
api-key(string, required) Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Do not expose this key on a website or embed it in a mobile application.
Path parameters
customer_id(string, required) — The unique identifier for the customer account.
Query parameters
client_secret(string | null) Token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK.accepted_countries(enum[] | null) The two-letter ISO country codes. Available options include (but are not limited to):AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ, ... ,US.accepted_currencies(enum[] | null) The three-letter ISO 4217 currency codes for the payment amount (e.g.,USD,EUR). Available options include:AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN, ... ,ZWL.amount(integer | null) The amount accepted for processing by the particular payment method.recurring_enabled(boolean | null) Whether the payment method is eligible for recurring payments.installment_payment_enabled(boolean | null) Whether the payment method is eligible for installment payments.limit(integer | null) Limit for last-used payment methods returned.card_networks(enum[] | null) Filter by card networks. Available options:Visa,Mastercard,AmericanExpress,JCB,DinersClub,Discover,CartesBancaires,UnionPay,Interac,RuPay,Maestro,Star,Pulse,Accel,Nyce.
Response schema
customer_payment_methods(object[]) — required List of payment methods for the customer. Each object may include attributes shown in the example above (payment token, method id, type, card details, bank details, surcharge_details, billing, etc).is_guest_customer(boolean | null) Returns whether a customer id is not tied to a payment intent (only when the request is made against a client secret).
Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/payment-methods/list-payment-methods-for-a-customer.mdx Raise an issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/payment-methods/list-payment-methods-for-a-customer
Related:
List customer saved payment methods for a Payment: https://api-reference.hyperswitch.io/v1/payment-methods/list-customer-saved-payment-methods-for-a-payment
Payment Method - Set Default Payment Method for Customer: https://api-reference.hyperswitch.io/v1/customer-set-default-payment-method/customers--set-default-payment-method