Simulate a 3DS challenge
curl --request POST \
--url https://api-dev.rain.xyz/v1/simulate/3ds-challenge \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 2,
"merchantName": "<string>"
}
'import requests
url = "https://api-dev.rain.xyz/v1/simulate/3ds-challenge"
payload = {
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 2,
"merchantName": "<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({
cardId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
transactionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 2,
merchantName: '<string>'
})
};
fetch('https://api-dev.rain.xyz/v1/simulate/3ds-challenge', 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://api-dev.rain.xyz/v1/simulate/3ds-challenge",
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([
'cardId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'transactionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 2,
'merchantName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <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://api-dev.rain.xyz/v1/simulate/3ds-challenge"
payload := strings.NewReader("{\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 2,\n \"merchantName\": \"<string>\"\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://api-dev.rain.xyz/v1/simulate/3ds-challenge")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 2,\n \"merchantName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/simulate/3ds-challenge")
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 \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 2,\n \"merchantName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"oneTimePassword": "<string>",
"expiryTime": "2023-11-07T05:31:56Z"
}Simulations
Simulate a 3DS challenge
Triggers a 3DS authentication challenge against a card to test your 3DS Forwarding webhook integration. The endpoint generates a one-time password (OTP), sends a challenge.requested webhook to your configured endpoint, and returns the challenge credentials.
Sandbox only. This endpoint returns 404 Not Found in production environments.
POST
/
simulate
/
3ds-challenge
Simulate a 3DS challenge
curl --request POST \
--url https://api-dev.rain.xyz/v1/simulate/3ds-challenge \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 2,
"merchantName": "<string>"
}
'import requests
url = "https://api-dev.rain.xyz/v1/simulate/3ds-challenge"
payload = {
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 2,
"merchantName": "<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({
cardId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
transactionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 2,
merchantName: '<string>'
})
};
fetch('https://api-dev.rain.xyz/v1/simulate/3ds-challenge', 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://api-dev.rain.xyz/v1/simulate/3ds-challenge",
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([
'cardId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'transactionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 2,
'merchantName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <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://api-dev.rain.xyz/v1/simulate/3ds-challenge"
payload := strings.NewReader("{\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 2,\n \"merchantName\": \"<string>\"\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://api-dev.rain.xyz/v1/simulate/3ds-challenge")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 2,\n \"merchantName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/simulate/3ds-challenge")
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 \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 2,\n \"merchantName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"oneTimePassword": "<string>",
"expiryTime": "2023-11-07T05:31:56Z"
}Authorizations
Body
application/json
3DS challenge simulation request
The Rain card ID to simulate the challenge for. Must be an active card belonging to your tenant.
The transaction ID to attach to the challenge.
The transaction amount in cents.
Required range:
x >= 1The merchant name to include in the challenge details.
The OTP delivery method. PUSH is not supported for simulation.
Available options:
SMS, EMAIL, WHATSAPP