Payment Method - Set Default Payment Method for Customer
Sets a customer's default payment method.
POST /{customer_id}/payment_methods/{payment_method_id}/default
Request example (cURL):
curl --request POST \
--url https://sandbox.hyperswitch.io/{customer_id}/payment_methods/{payment_method_id}/default \
--header 'api-key: <api-key>'Response (200):
{
"customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"payment_method": "card",
"default_payment_method_id": "card_rGK4Vi5iSW70MY7J2mIg",
"payment_method_type": "ach"
}Authorizations
Name:
api-keyType: string (header)
Required: yes
Notes: Ephemeral keys provide temporary access to singular data, such as access to a single customer object for a short period of time.
Path parameters
customer_id
string
yes
The unique identifier for the Customer
payment_method_id
string
yes
The unique identifier for the Payment Method
Response
Status: 200
Content-Type: application/json
Description: Payment Method has been set as default
Response properties:
customer_id
string
yes
The unique identifier of the customer. Required string length: 1 - 64. Example: cus_y3oqhf46pyzuxjbcn2giaqnb44
payment_method
enum
yes
Indicates the type of payment method. Eg: card, wallet, etc.
default_payment_method_id
string | null
—
The unique identifier of the Payment Method. Example: card_rGK4Vi5iSW70MY7J2mIg
payment_method_type
enum
—
Indicates the sub type of payment method. Eg: google_pay, apple_pay for wallets.
Was this page helpful?
Yes
No
Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/customer-set-default-payment-method/customers--set-default-payment-method.mdx Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/customer-set-default-payment-method/customers--set-default-payment-method
Related:
List payment methods for a Customer: https://api-reference.hyperswitch.io/v1/payment-methods/list-payment-methods-for-a-customer
Customers - Create: https://api-reference.hyperswitch.io/v1/customers/customers--create