Payment Method Session - Confirm a payment method session

POST /v2/payment-method-sessions/{id}/confirm

Description: Confirm a Payment Method Session by providing the payment method data and related options.

Example — cURL

Confirm payment method session (cURL)
curl --request POST \
  --url https://sandbox.hyperswitch.io/v2/payment-method-sessions/{id}/confirm \
  --header 'Content-Type: application/json' \
  --header 'X-Profile-Id: <x-profile-id>' \
  --header 'api-key: <api-key>' \
  --data '
{
  "payment_method_data": {
    "card": {
      "card_cvc": "123",
      "card_exp_month": "10",
      "card_exp_year": "25",
      "card_number": "4242424242424242"
    }
  },
  "payment_method_subtype": "credit",
  "payment_method_type": "card"
}
'

Example response (200)


Authorizations

  • Header: api-key (string) — required Publishable keys are a type of keys that can be public and have limited scope of usage.

Headers

  • X-Profile-Id (string) — required Profile ID associated to the payment intent.

Path Parameters

  • id (string) — required The unique identifier for the Payment Method Session.

Request body (application/json)

  • payment_method_type (string, enum) — required Indicates the type of payment method. Examples: card, wallet, etc.

  • payment_method_subtype (string, enum) — required Indicates the sub type of payment method. Example: google_pay, apple_pay for wallets.

  • payment_method_data (object) — required The payment method information provided for making a payment. Supported shapes include:

    • Card

    • CardRedirect

    • Wallet

    • PayLater

    • BankRedirect

    • BankDebit

    • BankTransfer

    • RealTimePayment

    • Crypto

    • Upi

    • Voucher

    • GiftCard

    • CardToken

    • OpenBanking

    • MobilePayment

    • NetworkToken

  • return_url (string | null) The return URL to which the customer should be redirected after adding the payment method.

  • storage_type (string, enum) Available options: volatile, persistent


Response (200 — application/json)

Payment Method created. Key response fields:

  • id (string) — required Example: "12345_pms_01926c58bc6e77c09e809964e72af8c8"

  • expires_at (string, date-time) — required ISO timestamp when the session will expire. Trying to retrieve or operate on the session after this time will result in an error. Example: "2023-01-18T11:04:09.922Z"

  • client_secret (string) — required Client secret. Example: "cs_9wcXDRVkfEtLEsSnYKgQ"

  • customer_id (string | null) The customer id for which the payment method session is created. Example: "12345_cus_01926c58bc6e77c09e809964e72af8c8"

  • billing (object) — contains address, phone and email

  • psp_tokenization (object) — Payment Service Provider configuration for methods created using the session

  • network_tokenization (object) — network tokenization configuration

  • tokenization_data (any | null) — data to pass to tokenization service (if present)

  • return_url (string | null) — URL to which the user should be redirected

  • next_action (object) — contains the URL for any redirection flow

  • authentication_details (object) — authentication status and error details (if any)

  • associated_payment_methods (array of objects | null) — payment methods created using this session

  • associated_token_id (string | null) — token ID created if tokenization_data was present

  • storage_type (string) — volatile or persistent

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


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