Payment Method - Get Payment Method Token Data
curl --request GET \
--url https://sandbox.hyperswitch.io/v1/payment-methods/token/{payment_method_temporary_token}/details \
--header 'Authorization: <api-key>' \
--header 'X-Profile-Id: <x-profile-id>'import requests
url = "https://sandbox.hyperswitch.io/v1/payment-methods/token/{payment_method_temporary_token}/details"
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-methods/token/{payment_method_temporary_token}/details', 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-methods/token/{payment_method_temporary_token}/details",
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-methods/token/{payment_method_temporary_token}/details"
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-methods/token/{payment_method_temporary_token}/details")
.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-methods/token/{payment_method_temporary_token}/details")
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{
"id": "0a_pm_019959146f92737389eb6927ce1eb7dc",
"payment_method_token": "token_CSum555d9YxDOpGwYq6q"
}Payment Methods
Payment Method - Get Payment Method Token Data
Retrieve the Payment method id associated with a payment method token.
GET
/
v1
/
payment-methods
/
token
/
{payment_method_temporary_token}
/
details
Payment Method - Get Payment Method Token Data
curl --request GET \
--url https://sandbox.hyperswitch.io/v1/payment-methods/token/{payment_method_temporary_token}/details \
--header 'Authorization: <api-key>' \
--header 'X-Profile-Id: <x-profile-id>'import requests
url = "https://sandbox.hyperswitch.io/v1/payment-methods/token/{payment_method_temporary_token}/details"
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-methods/token/{payment_method_temporary_token}/details', 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-methods/token/{payment_method_temporary_token}/details",
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-methods/token/{payment_method_temporary_token}/details"
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-methods/token/{payment_method_temporary_token}/details")
.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-methods/token/{payment_method_temporary_token}/details")
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{
"id": "0a_pm_019959146f92737389eb6927ce1eb7dc",
"payment_method_token": "token_CSum555d9YxDOpGwYq6q"
}Authorizations
Format: api-key=<api_key>
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.
Headers
Profile ID associated to the payment method
Path Parameters
The unique identifier for the Payment Method Token