Skip to main content
POST
/
payments
/
{payment_id}
/
3ds
/
authentication
Payments - External 3DS Authentication
curl --request POST \
  --url https://sandbox.hyperswitch.io/payments/{payment_id}/3ds/authentication \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "client_secret": "<string>",
  "sdk_information": {
    "sdk_app_id": "<string>",
    "sdk_enc_data": "<string>",
    "sdk_ephem_pub_key": {},
    "sdk_trans_id": "<string>",
    "sdk_reference_number": "<string>",
    "sdk_max_timeout": 1,
    "device_details": {
      "device_type": "<string>",
      "device_brand": "<string>",
      "device_os": "<string>",
      "device_display": "<string>"
    }
  }
}
'
import requests

url = "https://sandbox.hyperswitch.io/payments/{payment_id}/3ds/authentication"

payload = {
"client_secret": "<string>",
"sdk_information": {
"sdk_app_id": "<string>",
"sdk_enc_data": "<string>",
"sdk_ephem_pub_key": {},
"sdk_trans_id": "<string>",
"sdk_reference_number": "<string>",
"sdk_max_timeout": 1,
"device_details": {
"device_type": "<string>",
"device_brand": "<string>",
"device_os": "<string>",
"device_display": "<string>"
}
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_secret: '<string>',
sdk_information: {
sdk_app_id: '<string>',
sdk_enc_data: '<string>',
sdk_ephem_pub_key: {},
sdk_trans_id: '<string>',
sdk_reference_number: '<string>',
sdk_max_timeout: 1,
device_details: {
device_type: '<string>',
device_brand: '<string>',
device_os: '<string>',
device_display: '<string>'
}
}
})
};

fetch('https://sandbox.hyperswitch.io/payments/{payment_id}/3ds/authentication', 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/payments/{payment_id}/3ds/authentication",
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([
'client_secret' => '<string>',
'sdk_information' => [
'sdk_app_id' => '<string>',
'sdk_enc_data' => '<string>',
'sdk_ephem_pub_key' => [

],
'sdk_trans_id' => '<string>',
'sdk_reference_number' => '<string>',
'sdk_max_timeout' => 1,
'device_details' => [
'device_type' => '<string>',
'device_brand' => '<string>',
'device_os' => '<string>',
'device_display' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);

$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/payments/{payment_id}/3ds/authentication"

payload := strings.NewReader("{\n \"client_secret\": \"<string>\",\n \"sdk_information\": {\n \"sdk_app_id\": \"<string>\",\n \"sdk_enc_data\": \"<string>\",\n \"sdk_ephem_pub_key\": {},\n \"sdk_trans_id\": \"<string>\",\n \"sdk_reference_number\": \"<string>\",\n \"sdk_max_timeout\": 1,\n \"device_details\": {\n \"device_type\": \"<string>\",\n \"device_brand\": \"<string>\",\n \"device_os\": \"<string>\",\n \"device_display\": \"<string>\"\n }\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("api-key", "<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/payments/{payment_id}/3ds/authentication")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_secret\": \"<string>\",\n \"sdk_information\": {\n \"sdk_app_id\": \"<string>\",\n \"sdk_enc_data\": \"<string>\",\n \"sdk_ephem_pub_key\": {},\n \"sdk_trans_id\": \"<string>\",\n \"sdk_reference_number\": \"<string>\",\n \"sdk_max_timeout\": 1,\n \"device_details\": {\n \"device_type\": \"<string>\",\n \"device_brand\": \"<string>\",\n \"device_os\": \"<string>\",\n \"device_display\": \"<string>\"\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.hyperswitch.io/payments/{payment_id}/3ds/authentication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_secret\": \"<string>\",\n \"sdk_information\": {\n \"sdk_app_id\": \"<string>\",\n \"sdk_enc_data\": \"<string>\",\n \"sdk_ephem_pub_key\": {},\n \"sdk_trans_id\": \"<string>\",\n \"sdk_reference_number\": \"<string>\",\n \"sdk_max_timeout\": 1,\n \"device_details\": {\n \"device_type\": \"<string>\",\n \"device_brand\": \"<string>\",\n \"device_os\": \"<string>\",\n \"device_display\": \"<string>\"\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "three_ds_requestor_url": "<string>",
  "acs_url": "<string>",
  "challenge_request": "<string>",
  "challenge_request_key": "<string>",
  "acs_reference_number": "<string>",
  "acs_trans_id": "<string>",
  "three_dsserver_trans_id": "<string>",
  "acs_signed_content": "<string>",
  "three_ds_requestor_app_url": "<string>",
  "error_message": "<string>"
}
{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}

Authorizations

api-key
string
header
required

Publishable keys are a type of keys that can be public and have limited scope of usage.

Path Parameters

payment_id
string
required

The identifier for payment

Body

application/json
device_channel
enum<string>
required

Device Channel indicating whether request is coming from App or Browser

Available options:
APP,
BRW
threeds_method_comp_ind
enum<string>
required

Indicates if 3DS method data was successfully completed or not

Available options:
Y,
N,
U
client_secret
string | null

Client Secret

sdk_information
object | null

SDK Information if request is from SDK

Response

Authentication created

trans_status
enum<string>
required

Indicates the transaction status

Available options:
Y,
N,
U,
A,
R,
C,
D,
I
three_ds_requestor_url
string
required

Three DS Requestor URL

acs_url
string | null

Access Server URL to be used for challenge submission

challenge_request
string | null

Challenge request which should be sent to acs_url

challenge_request_key
string | null

Challenge request key which should be set as form field name for creq

acs_reference_number
string | null

Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)

acs_trans_id
string | null

Unique identifier assigned by the ACS to identify a single transaction

three_dsserver_trans_id
string | null

Unique identifier assigned by the 3DS Server to identify a single transaction

acs_signed_content
string | null

Contains the JWS object created by the ACS for the ARes(Authentication Response) message

three_ds_requestor_app_url
string | null

Merchant app declaring their URL within the CReq message so that the Authentication app can call the Merchant app after OOB authentication has occurred

error_message
string | null

Error message if any