JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_type: 'authorization',
card_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
amount: '100.50',
currency: 'USD',
merchant_name: 'COFFEE SHOP',
merchant_code: '5812'
})
};
fetch('https://api.example.com/transactions/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.example.com/transactions/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_type": "authorization",
"card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "100.50",
"currency": "USD",
"merchant_name": "COFFEE SHOP",
"merchant_code": "5812"
}
'import requests
url = "https://api.example.com/transactions/simulate"
payload = {
"transaction_type": "authorization",
"card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "100.50",
"currency": "USD",
"merchant_name": "COFFEE SHOP",
"merchant_code": "5812"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/transactions/simulate"
payload := strings.NewReader("{\n \"transaction_type\": \"authorization\",\n \"card_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"100.50\",\n \"currency\": \"USD\",\n \"merchant_name\": \"COFFEE SHOP\",\n \"merchant_code\": \"5812\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/transactions/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_type\": \"authorization\",\n \"card_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"100.50\",\n \"currency\": \"USD\",\n \"merchant_name\": \"COFFEE SHOP\",\n \"merchant_code\": \"5812\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/transactions/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_type\": \"authorization\",\n \"card_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"100.50\",\n \"currency\": \"USD\",\n \"merchant_name\": \"COFFEE SHOP\",\n \"merchant_code\": \"5812\"\n}"
response = http.request(request)
puts response.read_body{
"status": "approved",
"authorization_code": "ABC123",
"authorization_id": 98765432,
"authorization_date_time": "2025-06-15T14:30:00Z",
"settlement_amount": "100.50",
"mode_type": "DEBIT",
"card_mode": "CHIP",
"is_domestic_transaction": true
}{
"simulation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"challenge_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transaction": {
"status": "approved",
"authorization_code": "ABC123",
"authorization_id": 98765432,
"authorization_date_time": "2025-06-15T14:30:00Z",
"settlement_amount": "100.50",
"mode_type": "DEBIT",
"card_mode": "CHIP",
"is_domestic_transaction": true
},
"error": "<string>"
}{
"code": 123,
"message": "<string>"
}Simulator
Post transactionssimulate
Simulates a network transaction in sandbox environment. Validates card status and available balance similar to production.
POST
/
transactions
/
simulate
JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_type: 'authorization',
card_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
amount: '100.50',
currency: 'USD',
merchant_name: 'COFFEE SHOP',
merchant_code: '5812'
})
};
fetch('https://api.example.com/transactions/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.example.com/transactions/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_type": "authorization",
"card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "100.50",
"currency": "USD",
"merchant_name": "COFFEE SHOP",
"merchant_code": "5812"
}
'import requests
url = "https://api.example.com/transactions/simulate"
payload = {
"transaction_type": "authorization",
"card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "100.50",
"currency": "USD",
"merchant_name": "COFFEE SHOP",
"merchant_code": "5812"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/transactions/simulate"
payload := strings.NewReader("{\n \"transaction_type\": \"authorization\",\n \"card_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"100.50\",\n \"currency\": \"USD\",\n \"merchant_name\": \"COFFEE SHOP\",\n \"merchant_code\": \"5812\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/transactions/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_type\": \"authorization\",\n \"card_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"100.50\",\n \"currency\": \"USD\",\n \"merchant_name\": \"COFFEE SHOP\",\n \"merchant_code\": \"5812\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/transactions/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_type\": \"authorization\",\n \"card_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"100.50\",\n \"currency\": \"USD\",\n \"merchant_name\": \"COFFEE SHOP\",\n \"merchant_code\": \"5812\"\n}"
response = http.request(request)
puts response.read_body{
"status": "approved",
"authorization_code": "ABC123",
"authorization_id": 98765432,
"authorization_date_time": "2025-06-15T14:30:00Z",
"settlement_amount": "100.50",
"mode_type": "DEBIT",
"card_mode": "CHIP",
"is_domestic_transaction": true
}{
"simulation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"challenge_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transaction": {
"status": "approved",
"authorization_code": "ABC123",
"authorization_id": 98765432,
"authorization_date_time": "2025-06-15T14:30:00Z",
"settlement_amount": "100.50",
"mode_type": "DEBIT",
"card_mode": "CHIP",
"is_domestic_transaction": true
},
"error": "<string>"
}{
"code": 123,
"message": "<string>"
}Body
application/json
Transaction operation type. Determines the processing code sent to the network. When omitted, defaults to "purchase" for debit transactions.
Available options:
credit_reversal, credit_transfer, credit_voucher, debit_reversal, debit_transfer, deposit_by_bill, international_credit_voucher, international_purchase, international_purchase_reversal, international_withdrawal, national_withdrawal, purchase, purchase_quasi_cash, refund_purchase, reversal_international_withdrawal, reversal_purchase_quasi_cash, reverse_national_withdrawal, utilities_payment Response
The request has succeeded.