curl --request POST \
--url https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens"
payload = {}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens', 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/v2/payments/{payment_id}/create-external-sdk-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"session_token": [
{
"delayed_session_token": true,
"connector": "<string>",
"sdk_next_action": {
"next_action": "post_session_tokens",
"should_block_confirm": true
},
"wallet_name": "google_pay"
}
],
"vault_details": {
"internal_vault": {
"sdk_authorization": "<string>"
},
"external_vault_details": {
"vgs": {
"external_vault_id": "<string>",
"sdk_env": "<string>"
}
}
}
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}Payments - Session token
Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Hyperswitch’s SDK to initiate these wallets’ SDK.
curl --request POST \
--url https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens"
payload = {}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens', 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/v2/payments/{payment_id}/create-external-sdk-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v2/payments/{payment_id}/create-external-sdk-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"session_token": [
{
"delayed_session_token": true,
"connector": "<string>",
"sdk_next_action": {
"next_action": "post_session_tokens",
"should_block_confirm": true
},
"wallet_name": "google_pay"
}
],
"vault_details": {
"internal_vault": {
"sdk_authorization": "<string>"
},
"external_vault_details": {
"vgs": {
"external_vault_id": "<string>",
"sdk_env": "<string>"
}
}
}
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}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.
Path Parameters
The identifier for payment
Body
The body is of type object.
Response
Payment session object created or session token was retrieved from wallets
The identifier for the payment
The list of session token object
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
Show child attributes
Show child attributes
Top-level vault details returned in the session-tokens response. For v1: contains both internal vault (SDK authorization) and external vault details. For v2: contains only external vault details.
Show child attributes
Show child attributes