Payment Method Session - List Payment Methods
curl --request GET \
--url https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods \
--header 'Authorization: <api-key>' \
--header 'X-Profile-Id: <x-profile-id>'import requests
url = "https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods"
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Profile-Id': '<x-profile-id>', Authorization: '<api-key>'}
};
fetch('https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-Profile-Id: <x-profile-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_methods_enabled": [
{
"card_networks": [
{
"eligible_connectors": [
"stripe",
"adyen"
],
"surcharge_details": {
"surcharge": {
"type": "fixed",
"value": 123
},
"display_surcharge_amount": 123,
"display_tax_on_surcharge_amount": 123,
"display_total_surcharge_amount": 123,
"tax_on_surcharge": {
"percentage": 123
}
}
}
],
"required_fields": [
{
"required_field": "<string>",
"display_name": "<string>",
"field_type": "user_card_number",
"value": "<string>"
}
]
}
],
"customer_payment_methods": [
{
"payment_method_token": "7ebf443f-a050-4067-84e5-e6f6d4800aef",
"customer_id": "0a_cus_01926c58bc6e77c09e809964e72af8c8",
"recurring_enabled": true,
"created": "2023-01-18T11:04:09.922Z",
"requires_cvv": true,
"last_used_at": "2024-02-24T11:04:09.922Z",
"is_default": true,
"payment_method_data": {
"card": {
"saved_to_locker": true,
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": "fingerprint_12345",
"nick_name": "Card",
"card_isin": "4567890",
"card_issuer": "Issuer Bank",
"card_type": "Credit"
}
},
"bank": {
"mask": "<string>"
},
"billing": {
"address": {
"city": "New York",
"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>"
}
}
]
}Payment Method Session
Payment Method Session - List Payment Methods
List payment methods for the given payment method session. This endpoint lists the enabled payment methods for the profile and the saved payment methods of the customer.
GET
/
v1
/
payment-method-sessions
/
{id}
/
list-payment-methods
Payment Method Session - List Payment Methods
curl --request GET \
--url https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods \
--header 'Authorization: <api-key>' \
--header 'X-Profile-Id: <x-profile-id>'import requests
url = "https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods"
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Profile-Id': '<x-profile-id>', Authorization: '<api-key>'}
};
fetch('https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-Profile-Id: <x-profile-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v1/payment-method-sessions/{id}/list-payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_methods_enabled": [
{
"card_networks": [
{
"eligible_connectors": [
"stripe",
"adyen"
],
"surcharge_details": {
"surcharge": {
"type": "fixed",
"value": 123
},
"display_surcharge_amount": 123,
"display_tax_on_surcharge_amount": 123,
"display_total_surcharge_amount": 123,
"tax_on_surcharge": {
"percentage": 123
}
}
}
],
"required_fields": [
{
"required_field": "<string>",
"display_name": "<string>",
"field_type": "user_card_number",
"value": "<string>"
}
]
}
],
"customer_payment_methods": [
{
"payment_method_token": "7ebf443f-a050-4067-84e5-e6f6d4800aef",
"customer_id": "0a_cus_01926c58bc6e77c09e809964e72af8c8",
"recurring_enabled": true,
"created": "2023-01-18T11:04:09.922Z",
"requires_cvv": true,
"last_used_at": "2024-02-24T11:04:09.922Z",
"is_default": true,
"payment_method_data": {
"card": {
"saved_to_locker": true,
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": "fingerprint_12345",
"nick_name": "Card",
"card_isin": "4567890",
"card_issuer": "Issuer Bank",
"card_type": "Credit"
}
},
"bank": {
"mask": "<string>"
},
"billing": {
"address": {
"city": "New York",
"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>"
}
}
]
}Authorizations
Format: publishable-key=<publishable-key>,client-secret=<client-secret>
Publishable keys are a type of keys that can be public and have limited scope of usage. Client Secret provide temporary access to singular data, such as access to a single customer object for a short period of time. This authentication scheme is used by the SDK.
Headers
Profile ID associated to the payment method session
Path Parameters
The unique identifier for the Payment Method Session
Response
The payment method session is retrieved successfully
Was this page helpful?
⌘I