Payment Method - Update
POST https://sandbox.hyperswitch.io/payment_methods/{method_id}/update
Request example (cURL)
curl --request POST \
--url https://sandbox.hyperswitch.io/payment_methods/{method_id}/update \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"card": {
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"nick_name": "John Doe",
"last4_digits": "1111",
"card_issuer": "Bank of America",
"issuer_country": "US",
"issuer_country_code": "US",
"card_network": "VISA"
},
"wallet": {
"last4": "<string>",
"card_network": "<string>",
"type": "<string>",
"card_exp_month": "10",
"card_exp_year": "25"
},
"client_secret": "secret_k2uj3he2893eiu2d"
}
'Successful response (200)
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. Don't expose this key on a website or embed it in a mobile application.
Path parameters
method_id (string, required) — The unique identifier for the Payment Method
Request body
Content-Type: application/json
card (object) — Card attributes (see response
cardobject for fields)wallet (object) — Wallet attributes
client_secret (string | null) — This is a 15 minute expiry token used from the client to authenticate and perform sessions from the SDK
Required string length: 30
Example:
"secret_k2uj3he2893eiu2d"
Response (200) — Fields
Content-Type: application/json — Payment Method updated
merchant_id (string, required) — Unique identifier for a merchant Example:
"merchant_1671528864"payment_method_id (string, required) — The unique identifier of the Payment method Example:
"card_rGK4Vi5iSW70MY7J2mIg"payment_method (enum, required) — Indicates the type of payment method. Eg:
card,wallet, etc. Available options:card,card_redirect,pay_later,wallet,bank_redirect,bank_transfer,crypto,bank_debit,reward,real_time_payment,upi,voucher,gift_card,open_banking,mobile_payment,network_tokencustomer_id (string | null) — The unique identifier of the customer. Required string length: 1–64 Example:
"cus_y3oqhf46pyzuxjbcn2giaqnb44"payment_method_type (enum) — Indicates the sub type of payment method (e.g.,
google_pay,apple_payfor wallets). See expanded list below.
card (object) — Card object with attributes:
saved_to_locker (boolean)
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 (string) — e.g., "Visa"
card_isin (string)
card_issuer (string)
card_type (string)
recurring_enabled (boolean | null) — Indicates whether the payment method supports recurring payments. Example:
trueinstallment_payment_enabled (boolean | null) — Indicates whether eligible for installment payments. Example:
truepayment_experience (enum[] | null) — Type of payment experience enabled with the connector. Available options:
redirect_to_url,invoke_sdk_client,display_qr_code,one_click,link_wallet,invoke_payment_app,display_wait_screen,collect_otpExample:["redirect_to_url"]metadata (object) — Up to 50 keys; key names up to 40 chars, values up to 500 chars.
created (string | null) — ISO 8601 timestamp when the payment method was created. Example:
"2023-01-18T11:04:09.922Z"bank_transfer (object) — Bank transfer details:
bank_account_number
bank_routing_number
bank_name
bank_country_code
bank_city
last_used_at (string | null) — Example:
"2024-02-24T11:04:09.922Z"client_secret (string | null) — For client-based calls
If you need to suggest edits or raise an issue on the docs, the original repository links are:
Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/payment-methods/payment-method--update.mdx
Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/payment-methods/payment-method--update
Related pages:
Payment Method — Retrieve: https://api-reference.hyperswitch.io/v1/payment-methods/payment-method--retrieve
Payment Method — Delete: https://api-reference.hyperswitch.io/v1/payment-methods/payment-method--delete