Simulate transaction event in sandbox environment
curl --request POST \
--url https://dev.sbx.imprint.co/v2/simulate_transaction_event \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
"status": "APPROVED",
"event_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"amount": 5000,
"currency": "USD",
"authorization_code": "645432",
"network_transaction_id": "txn-789456",
"purchase_method": "CHIP",
"merchant": {
"network_id": "234923454545",
"name": "Target",
"category": "Grocery Stores",
"category_code": "5411",
"address": {
"street_line1": "123 Main St",
"street_line2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "USA"
}
},
"evaluate_authorization": false
}
'import requests
url = "https://dev.sbx.imprint.co/v2/simulate_transaction_event"
payload = {
"payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
"status": "APPROVED",
"event_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"amount": 5000,
"currency": "USD",
"authorization_code": "645432",
"network_transaction_id": "txn-789456",
"purchase_method": "CHIP",
"merchant": {
"network_id": "234923454545",
"name": "Target",
"category": "Grocery Stores",
"category_code": "5411",
"address": {
"street_line1": "123 Main St",
"street_line2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "USA"
}
},
"evaluate_authorization": False
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method_id: '7f754378-dd84-4a9a-b1ce-0646bb769c29',
status: 'APPROVED',
event_id: 'e2806932-5f1b-4518-8b15-156d773e9496',
transaction_id: 'e2806932-5f1b-4518-8b15-156d773e9496',
amount: 5000,
currency: 'USD',
authorization_code: '645432',
network_transaction_id: 'txn-789456',
purchase_method: 'CHIP',
merchant: {
network_id: '234923454545',
name: 'Target',
category: 'Grocery Stores',
category_code: '5411',
address: {
street_line1: '123 Main St',
street_line2: 'Apt 4B',
city: 'San Francisco',
state: 'CA',
postal_code: '94105',
country: 'USA'
}
},
evaluate_authorization: false
})
};
fetch('https://dev.sbx.imprint.co/v2/simulate_transaction_event', 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://dev.sbx.imprint.co/v2/simulate_transaction_event",
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([
'payment_method_id' => '7f754378-dd84-4a9a-b1ce-0646bb769c29',
'status' => 'APPROVED',
'event_id' => 'e2806932-5f1b-4518-8b15-156d773e9496',
'transaction_id' => 'e2806932-5f1b-4518-8b15-156d773e9496',
'amount' => 5000,
'currency' => 'USD',
'authorization_code' => '645432',
'network_transaction_id' => 'txn-789456',
'purchase_method' => 'CHIP',
'merchant' => [
'network_id' => '234923454545',
'name' => 'Target',
'category' => 'Grocery Stores',
'category_code' => '5411',
'address' => [
'street_line1' => '123 Main St',
'street_line2' => 'Apt 4B',
'city' => 'San Francisco',
'state' => 'CA',
'postal_code' => '94105',
'country' => 'USA'
]
],
'evaluate_authorization' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://dev.sbx.imprint.co/v2/simulate_transaction_event"
payload := strings.NewReader("{\n \"payment_method_id\": \"7f754378-dd84-4a9a-b1ce-0646bb769c29\",\n \"status\": \"APPROVED\",\n \"event_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"transaction_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"authorization_code\": \"645432\",\n \"network_transaction_id\": \"txn-789456\",\n \"purchase_method\": \"CHIP\",\n \"merchant\": {\n \"network_id\": \"234923454545\",\n \"name\": \"Target\",\n \"category\": \"Grocery Stores\",\n \"category_code\": \"5411\",\n \"address\": {\n \"street_line1\": \"123 Main St\",\n \"street_line2\": \"Apt 4B\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94105\",\n \"country\": \"USA\"\n }\n },\n \"evaluate_authorization\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://dev.sbx.imprint.co/v2/simulate_transaction_event")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"payment_method_id\": \"7f754378-dd84-4a9a-b1ce-0646bb769c29\",\n \"status\": \"APPROVED\",\n \"event_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"transaction_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"authorization_code\": \"645432\",\n \"network_transaction_id\": \"txn-789456\",\n \"purchase_method\": \"CHIP\",\n \"merchant\": {\n \"network_id\": \"234923454545\",\n \"name\": \"Target\",\n \"category\": \"Grocery Stores\",\n \"category_code\": \"5411\",\n \"address\": {\n \"street_line1\": \"123 Main St\",\n \"street_line2\": \"Apt 4B\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94105\",\n \"country\": \"USA\"\n }\n },\n \"evaluate_authorization\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.sbx.imprint.co/v2/simulate_transaction_event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method_id\": \"7f754378-dd84-4a9a-b1ce-0646bb769c29\",\n \"status\": \"APPROVED\",\n \"event_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"transaction_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"authorization_code\": \"645432\",\n \"network_transaction_id\": \"txn-789456\",\n \"purchase_method\": \"CHIP\",\n \"merchant\": {\n \"network_id\": \"234923454545\",\n \"name\": \"Target\",\n \"category\": \"Grocery Stores\",\n \"category_code\": \"5411\",\n \"address\": {\n \"street_line1\": \"123 Main St\",\n \"street_line2\": \"Apt 4B\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94105\",\n \"country\": \"USA\"\n }\n },\n \"evaluate_authorization\": false\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "E777214A-2D11-4CAD-9E8F-E1BD71D9FE67",
"event_id": "E777214A-2D11-4CAD-9E8F-E1BD71D9FE67",
"status": "APPROVED",
"authorization_approved": true,
"authorization_reason": "<string>"
}{
"type": "<string>",
"message": "<string>"
}Simulate Transaction Event
Simulate transaction event in sandbox environment
POST
/
v2
/
simulate_transaction_event
Simulate transaction event in sandbox environment
curl --request POST \
--url https://dev.sbx.imprint.co/v2/simulate_transaction_event \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
"status": "APPROVED",
"event_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"amount": 5000,
"currency": "USD",
"authorization_code": "645432",
"network_transaction_id": "txn-789456",
"purchase_method": "CHIP",
"merchant": {
"network_id": "234923454545",
"name": "Target",
"category": "Grocery Stores",
"category_code": "5411",
"address": {
"street_line1": "123 Main St",
"street_line2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "USA"
}
},
"evaluate_authorization": false
}
'import requests
url = "https://dev.sbx.imprint.co/v2/simulate_transaction_event"
payload = {
"payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
"status": "APPROVED",
"event_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"amount": 5000,
"currency": "USD",
"authorization_code": "645432",
"network_transaction_id": "txn-789456",
"purchase_method": "CHIP",
"merchant": {
"network_id": "234923454545",
"name": "Target",
"category": "Grocery Stores",
"category_code": "5411",
"address": {
"street_line1": "123 Main St",
"street_line2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "USA"
}
},
"evaluate_authorization": False
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method_id: '7f754378-dd84-4a9a-b1ce-0646bb769c29',
status: 'APPROVED',
event_id: 'e2806932-5f1b-4518-8b15-156d773e9496',
transaction_id: 'e2806932-5f1b-4518-8b15-156d773e9496',
amount: 5000,
currency: 'USD',
authorization_code: '645432',
network_transaction_id: 'txn-789456',
purchase_method: 'CHIP',
merchant: {
network_id: '234923454545',
name: 'Target',
category: 'Grocery Stores',
category_code: '5411',
address: {
street_line1: '123 Main St',
street_line2: 'Apt 4B',
city: 'San Francisco',
state: 'CA',
postal_code: '94105',
country: 'USA'
}
},
evaluate_authorization: false
})
};
fetch('https://dev.sbx.imprint.co/v2/simulate_transaction_event', 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://dev.sbx.imprint.co/v2/simulate_transaction_event",
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([
'payment_method_id' => '7f754378-dd84-4a9a-b1ce-0646bb769c29',
'status' => 'APPROVED',
'event_id' => 'e2806932-5f1b-4518-8b15-156d773e9496',
'transaction_id' => 'e2806932-5f1b-4518-8b15-156d773e9496',
'amount' => 5000,
'currency' => 'USD',
'authorization_code' => '645432',
'network_transaction_id' => 'txn-789456',
'purchase_method' => 'CHIP',
'merchant' => [
'network_id' => '234923454545',
'name' => 'Target',
'category' => 'Grocery Stores',
'category_code' => '5411',
'address' => [
'street_line1' => '123 Main St',
'street_line2' => 'Apt 4B',
'city' => 'San Francisco',
'state' => 'CA',
'postal_code' => '94105',
'country' => 'USA'
]
],
'evaluate_authorization' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://dev.sbx.imprint.co/v2/simulate_transaction_event"
payload := strings.NewReader("{\n \"payment_method_id\": \"7f754378-dd84-4a9a-b1ce-0646bb769c29\",\n \"status\": \"APPROVED\",\n \"event_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"transaction_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"authorization_code\": \"645432\",\n \"network_transaction_id\": \"txn-789456\",\n \"purchase_method\": \"CHIP\",\n \"merchant\": {\n \"network_id\": \"234923454545\",\n \"name\": \"Target\",\n \"category\": \"Grocery Stores\",\n \"category_code\": \"5411\",\n \"address\": {\n \"street_line1\": \"123 Main St\",\n \"street_line2\": \"Apt 4B\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94105\",\n \"country\": \"USA\"\n }\n },\n \"evaluate_authorization\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://dev.sbx.imprint.co/v2/simulate_transaction_event")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"payment_method_id\": \"7f754378-dd84-4a9a-b1ce-0646bb769c29\",\n \"status\": \"APPROVED\",\n \"event_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"transaction_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"authorization_code\": \"645432\",\n \"network_transaction_id\": \"txn-789456\",\n \"purchase_method\": \"CHIP\",\n \"merchant\": {\n \"network_id\": \"234923454545\",\n \"name\": \"Target\",\n \"category\": \"Grocery Stores\",\n \"category_code\": \"5411\",\n \"address\": {\n \"street_line1\": \"123 Main St\",\n \"street_line2\": \"Apt 4B\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94105\",\n \"country\": \"USA\"\n }\n },\n \"evaluate_authorization\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.sbx.imprint.co/v2/simulate_transaction_event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method_id\": \"7f754378-dd84-4a9a-b1ce-0646bb769c29\",\n \"status\": \"APPROVED\",\n \"event_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"transaction_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"authorization_code\": \"645432\",\n \"network_transaction_id\": \"txn-789456\",\n \"purchase_method\": \"CHIP\",\n \"merchant\": {\n \"network_id\": \"234923454545\",\n \"name\": \"Target\",\n \"category\": \"Grocery Stores\",\n \"category_code\": \"5411\",\n \"address\": {\n \"street_line1\": \"123 Main St\",\n \"street_line2\": \"Apt 4B\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94105\",\n \"country\": \"USA\"\n }\n },\n \"evaluate_authorization\": false\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "E777214A-2D11-4CAD-9E8F-E1BD71D9FE67",
"event_id": "E777214A-2D11-4CAD-9E8F-E1BD71D9FE67",
"status": "APPROVED",
"authorization_approved": true,
"authorization_reason": "<string>"
}{
"type": "<string>",
"message": "<string>"
}Authorizations
basicAuthbearerAuth
Body
application/json
Response
Transaction event created successfully