Payment Method Session - Retrieve

Retrieve a Payment Method Session.

Endpoint GET /v2/payment-method-sessions/{id}

cURL

curl --request GET \
  --url https://sandbox.hyperswitch.io/v2/payment-method-sessions/{id} \
  --header 'api-key: <api-key>'

Response (200 — application/json)

{
  "id": "12345_pms_01926c58bc6e77c09e809964e72af8c8",
  "expires_at": "2023-01-18T11:04:09.922Z",
  "client_secret": "cs_9wcXDRVkfEtLEsSnYKgQ",
  "customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
  "billing": {
    "address": {
      "city": "New York",
      "country": "AF",
      "line1": "123, King Street",
      "line2": "Powelson Avenue",
      "line3": "Bridgewater",
      "zip": "08807",
      "state": "New York",
      "first_name": "John",
      "last_name": "Doe",
      "origin_zip": "08807"
    },
    "phone": {
      "number": "9123456789",
      "country_code": "+1"
    },
    "email": "<string>"
  },
  "psp_tokenization": {
    "tokenization_type": "single_use",
    "connector_id": "mca_28a7367sad8239s67"
  },
  "network_tokenization": {
    "enable": "Enable"
  },
  "tokenization_data": "<unknown>",
  "return_url": "https://merchant-website.com/return",
  "next_action": {
    "redirect_to_url": "https://example.com/redirect",
    "type": "redirect_to_url"
  },
  "authentication_details": {
    "status": "succeeded",
    "error": {
      "code": "card_declined",
      "message": "The card was declined.",
      "reason": "The card was declined.",
      "unified_code": "card_declined",
      "unified_message": "The card was declined.",
      "network_advice_code": "01",
      "network_decline_code": "05",
      "network_error_message": "Do not retry"
    }
  },
  "associated_payment_methods": [
    {
      "payment_method_token": {
        "type": "payment_method_session_token",
        "data": "token_9wcXDRVkfEtLEsSnYKgQ"
      }
    }
  ],
  "associated_token_id": "12345_tok_01926c58bc6e77c09e809964e72af8c8",
  "storage_type": "volatile",
  "card_cvc_token_storage": {
    "is_stored": true,
    "expires_at": "2024-02-24T11:04:09.922Z"
  }
}

Authorizations

  • api-key (string, header, required) Ephemeral keys provide temporary access to singular data, such as access to a single customer object for a short period of time.

Path Parameters

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

Response Fields (selected)

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

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

  • client_secret (string, required) Client secret for the session. Example: "cs_9wcXDRVkfEtLEsSnYKgQ"

  • customer_id (string | null) Customer id associated with the session. Example: "12345_cus_01926c58bc6e77c09e809964e72af8c8"

  • billing (object) Contains billing address, phone, and email.

  • psp_tokenization (object) Payment Service Provider configuration used for payment methods created via this session.

  • network_tokenization (object) Network tokenization configuration for the session.

  • tokenization_data (any | null) Data to pass to a tokenization service (if present) to create a token_id for the provided JSON.

  • return_url (string | null) URL to which the user should be redirected after completion. Example: "https://merchant-website.com/return"

  • next_action (object) Contains URL and type for redirection flow (e.g., redirect_to_url).

  • authentication_details (object) Authentication status and error details (if any).

  • associated_payment_methods (object[] | null) Payment methods created using this payment method session.

  • associated_token_id (string | null) Token id created if tokenization_data is present. Example: "12345_tok_01926c58bc6e77c09e809964e72af8c8"

  • storage_type (enum) Available options: volatile, persistent

  • card_cvc_token_storage (object) Indicates whether the card CVC token is stored and its expiry.

Related

  • Payment Method Session — Create: https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--create

  • Payment Method Session — List Payment Methods: https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--list-payment-methods

Edit or raise an issue

  • Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v2/payment-method-session/payment-method-session--retrieve.mdx

  • Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v2/payment-method-session/payment-method-session--retrieve