Payment Method - Update

PATCH /v2/payment-methods/{id}/update-saved-payment-method

Updates a saved payment method.


Request (cURL)

curl
curl --request PATCH \
  --url https://sandbox.hyperswitch.io/v2/payment-methods/{id}/update-saved-payment-method \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "payment_method_data": {
    "card": {
      "card_holder_name": "John Doe",
      "nick_name": "John Doe",
      "card_cvc": "242"
    }
  },
  "connector_token_details": {
    "token": "pm_9UhMqBMEOooRIvJFFdeW",
    "connector_token_request_reference_id": "<string>"
  }
}
'

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. Do not expose this key on a website or embed it in a mobile application.


Request Body (application/json)

  • payment_method_data (object)

    • Example shown uses card with fields:

      • card_holder_name

      • nick_name

      • card_cvc

  • connector_token_details (object) — Token information that can be used to initiate transactions by the merchant.

    • token

    • connector_token_request_reference_id

(Child attributes are available for both objects in the API reference.)


Response (application/json)

Top-level fields returned in the Payment Method Update response:

  • id (string, required) — The unique identifier of the Payment method Example: "12345_pm_01926c58bc6e77c09e809964e72af8c8"

  • merchant_id (string, required) — Unique identifier for a merchant Example: "merchant_1671528864"

  • customer_id (string, required) — The unique identifier of the customer (32–64 chars) Example: "12345_cus_01926c58bc6e77c09e809964e72af8c8"

  • payment_method_type (enum, required) — Type of payment method (e.g., card, wallet, network_token, etc.)

  • payment_method_subtype (enum) — Subtype of payment method (e.g., google_pay, apple_pay, ach, credit, debit, etc.)

  • recurring_enabled (boolean | null) — Indicates whether the payment method supports recurring payments

  • created (string | null) — ISO 8601 timestamp when the payment method was created

  • last_used_at (string | null) — ISO 8601 timestamp when the payment method was last used

  • payment_method_data (object) — Details about the payment method (child attributes depend on type; example includes card fields such as last4_digits, expiry_month, expiry_year, card_holder_name, card_network, etc.)

  • connector_tokens (object[] | null) — Connector token details if available

  • network_token (object) — Network token data (contains payment_method_data for the network token)

  • storage_type (enum) — "volatile" or "persistent"

  • card_cvc_token_storage (object) — CVC token storage info (e.g., is_stored, expires_at)

For full child attribute details and exhaustive lists of enum options, see the API reference: https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--update


Related:

  • Payment Method - Confirm Intent: https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--confirm-intent

  • Payment Method - Retrieve: https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--retrieve

Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v2/payment-methods/payment-method--update.mdx Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v2/payment-methods/payment-method--update