Skip to main content
POST
/
payment_methods
/
{method_id}
/
update
Payment Method - Update
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"
  },
  "client_secret": "secret_k2uj3he2893eiu2d"
}'
{
  "merchant_id": "merchant_1671528864",
  "customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
  "payment_method_id": "card_rGK4Vi5iSW70MY7J2mIg",
  "payment_method": "card",
  "payment_method_type": "ach",
  "card": {
    "scheme": "<string>",
    "issuer_country": "<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>",
    "saved_to_locker": true
  },
  "recurring_enabled": true,
  "installment_payment_enabled": true,
  "payment_experience": [
    "redirect_to_url"
  ],
  "metadata": {},
  "created": "2023-01-18T11:04:09.922Z",
  "bank_transfer": {
    "bank_name": "Deutsche Bank",
    "bank_country_code": "AF",
    "bank_city": "California",
    "bank_account_number": "000123456",
    "bank_routing_number": "110000000"
  },
  "last_used_at": "2024-02-24T11:04:09.922Z",
  "client_secret": "<string>"
}

Authorizations

api-key
string
header
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

Body

application/json
card
object
client_secret
string | null

This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK

Required string length: 30
Example:

"secret_k2uj3he2893eiu2d"

Response

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<string>
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
customer_id
string | null

The unique identifier of the customer.

Required string length: 1 - 64
Example:

"cus_y3oqhf46pyzuxjbcn2giaqnb44"

payment_method_type
enum<string>

Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.

Available options:
ach,
affirm,
afterpay_clearpay,
alfamart,
ali_pay,
ali_pay_hk,
alma,
amazon_pay,
paysera,
apple_pay,
atome,
bacs,
bancontact_card,
becs,
benefit,
bizum,
blik,
bluecode,
boleto,
bca_bank_transfer,
bni_va,
breadpay,
bri_va,
bhn_card_network,
card_redirect,
cimb_va,
classic,
credit,
crypto_currency,
cashapp,
dana,
danamon_va,
debit,
duit_now,
efecty,
eft,
eps,
flexiti,
fps,
evoucher,
giropay,
givex,
google_pay,
go_pay,
gcash,
ideal,
interac,
indomaret,
klarna,
kakao_pay,
local_bank_redirect,
mandiri_va,
knet,
mb_way,
mobile_pay,
momo,
momo_atm,
multibanco,
online_banking_thailand,
online_banking_czech_republic,
online_banking_finland,
online_banking_fpx,
online_banking_poland,
online_banking_slovakia,
oxxo,
pago_efectivo,
permata_bank_transfer,
open_banking_uk,
pay_bright,
paypal,
paze,
pix,
pay_safe_card,
przelewy24,
prompt_pay,
pse,
red_compra,
red_pagos,
samsung_pay,
sepa,
sepa_bank_transfer,
skrill,
sofort,
swish,
touch_n_go,
trustly,
twint,
upi_collect,
upi_intent,
vipps,
viet_qr,
venmo,
walley,
we_chat_pay,
seven_eleven,
lawson,
mini_stop,
family_mart,
seicomart,
pay_easy,
local_bank_transfer,
mifinity,
open_banking_pis,
direct_carrier_billing,
instant_bank_transfer,
instant_bank_transfer_finland,
instant_bank_transfer_poland,
revolut_pay,
indonesian_bank_transfer
card
object
recurring_enabled
boolean | null

Indicates whether the payment method supports recurring payments. Optional.

Example:

true

installment_payment_enabled
boolean | null

Indicates whether the payment method is eligible for installment payments (e.g., EMI, BNPL). Optional.

Example:

true

payment_experience
enum<string>[] | null

Type of payment experience enabled with the connector

Example:
["redirect_to_url"]
metadata
object | null

You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.

created
string<date-time> | null

A timestamp (ISO 8601 code) that determines when the payment method was created

Example:

"2023-01-18T11:04:09.922Z"

bank_transfer
object
  • Option 1
  • Option 2
  • Option 3
  • Option 4
last_used_at
string<date-time> | null
Example:

"2024-02-24T11:04:09.922Z"

client_secret
string | null

For Client based calls