JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
authorization_code: '<string>',
currency: 'USD'
})
};
fetch('https://api.example.com/transactions/scenarios/{name}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.example.com/transactions/scenarios/{name}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"authorization_code": "<string>",
"currency": "USD"
}
'import requests
url = "https://api.example.com/transactions/scenarios/{name}/run"
payload = {
"card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"authorization_code": "<string>",
"currency": "USD"
}
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/scenarios/{name}/run"
payload := strings.NewReader("{\n \"card_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"authorization_code\": \"<string>\",\n \"currency\": \"USD\"\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/scenarios/{name}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"card_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"authorization_code\": \"<string>\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/transactions/scenarios/{name}/run")
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 \"card_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"authorization_code\": \"<string>\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"scenario_name": "<string>",
"status": "passed",
"steps": [
{
"index": 123,
"transaction_type": "authorization",
"amount": "<string>",
"currency": "<string>",
"operation": "credit_reversal",
"replacement_amount": "<string>",
"status": "approved",
"authorization_code": "<string>",
"denial_code": "<string>",
"denial_reason": "<string>",
"expected_status": "approved",
"matched_expectation": true,
"error": "<string>"
}
],
"steps_requests": [
{
"transaction_type": "authorization",
"card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "100.50",
"currency": "USD",
"merchant_name": "COFFEE SHOP",
"merchant_code": "5812"
}
]
}{
"code": 123,
"message": "<string>"
}Simulator
Post transactionsscenarios run
Runs one scenario against a card and returns the result of each step.
POST
/
transactions
/
scenarios
/
{name}
/
run
JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
authorization_code: '<string>',
currency: 'USD'
})
};
fetch('https://api.example.com/transactions/scenarios/{name}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.example.com/transactions/scenarios/{name}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"authorization_code": "<string>",
"currency": "USD"
}
'import requests
url = "https://api.example.com/transactions/scenarios/{name}/run"
payload = {
"card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"authorization_code": "<string>",
"currency": "USD"
}
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/scenarios/{name}/run"
payload := strings.NewReader("{\n \"card_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"authorization_code\": \"<string>\",\n \"currency\": \"USD\"\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/scenarios/{name}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"card_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"authorization_code\": \"<string>\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/transactions/scenarios/{name}/run")
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 \"card_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"authorization_code\": \"<string>\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"scenario_name": "<string>",
"status": "passed",
"steps": [
{
"index": 123,
"transaction_type": "authorization",
"amount": "<string>",
"currency": "<string>",
"operation": "credit_reversal",
"replacement_amount": "<string>",
"status": "approved",
"authorization_code": "<string>",
"denial_code": "<string>",
"denial_reason": "<string>",
"expected_status": "approved",
"matched_expectation": true,
"error": "<string>"
}
],
"steps_requests": [
{
"transaction_type": "authorization",
"card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "100.50",
"currency": "USD",
"merchant_name": "COFFEE SHOP",
"merchant_code": "5812"
}
]
}{
"code": 123,
"message": "<string>"
}Path Parameters
Name of a simulation scenario available to run. Amounts are in the run currency unless the scenario names one.
Available options:
purchase_auth_equal_clearing, purchase_overcapture, purchase_undercapture, purchase_reversal, purchase_bigger_replacement, purchase_lower_replacement, purchase_auth_only, purchase_partial_cancellation_part_1, purchase_partial_cancellation_part_2, purchase_full_cancellation_part_1, purchase_full_cancellation_part_2, national_withdrawal_auth_clearing, international_purchase_auth_clearing, international_withdrawal_auth_clearing, credit_voucher_auth_confirmation, international_credit_voucher_auth_confirmation, brl_cross_currency_auth_clearing, brl_cross_currency_reversal Body
application/json
Response
The request has succeeded.