Simulate a card transaction
curl --request POST \
--url https://api.contro.me/v1/partner/sandbox/simulate-transaction \
--header 'Content-Type: application/json' \
--header 'x-contro-api-key: <api-key>' \
--data '
{
"cardId": "card_sandbox_123",
"amount": 2500,
"currency": "USD",
"merchantName": "Test Coffee Shop",
"type": "purchase",
"originalTransactionId": "<string>"
}
'import requests
url = "https://api.contro.me/v1/partner/sandbox/simulate-transaction"
payload = {
"cardId": "card_sandbox_123",
"amount": 2500,
"currency": "USD",
"merchantName": "Test Coffee Shop",
"type": "purchase",
"originalTransactionId": "<string>"
}
headers = {
"x-contro-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-contro-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cardId: 'card_sandbox_123',
amount: 2500,
currency: 'USD',
merchantName: 'Test Coffee Shop',
type: 'purchase',
originalTransactionId: '<string>'
})
};
fetch('https://api.contro.me/v1/partner/sandbox/simulate-transaction', 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.contro.me/v1/partner/sandbox/simulate-transaction",
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' => 'card_sandbox_123',
'amount' => 2500,
'currency' => 'USD',
'merchantName' => 'Test Coffee Shop',
'type' => 'purchase',
'originalTransactionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-contro-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://api.contro.me/v1/partner/sandbox/simulate-transaction"
payload := strings.NewReader("{\n \"cardId\": \"card_sandbox_123\",\n \"amount\": 2500,\n \"currency\": \"USD\",\n \"merchantName\": \"Test Coffee Shop\",\n \"type\": \"purchase\",\n \"originalTransactionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-contro-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.contro.me/v1/partner/sandbox/simulate-transaction")
.header("x-contro-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"card_sandbox_123\",\n \"amount\": 2500,\n \"currency\": \"USD\",\n \"merchantName\": \"Test Coffee Shop\",\n \"type\": \"purchase\",\n \"originalTransactionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contro.me/v1/partner/sandbox/simulate-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-contro-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"card_sandbox_123\",\n \"amount\": 2500,\n \"currency\": \"USD\",\n \"merchantName\": \"Test Coffee Shop\",\n \"type\": \"purchase\",\n \"originalTransactionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transactionId": "<string>",
"amount": 123,
"currency": "<string>",
"status": "<string>"
}Sandbox
Simulate a card transaction
Simulate a settled card purchase (or a refund of a prior simulated purchase) in sandbox mode. Mirrors live settlement: deducts spend plus fees from the sandbox balance exactly once, evaluates balance thresholds, and fires the same webhook sequence as live.
POST
/
partner
/
sandbox
/
simulate-transaction
Simulate a card transaction
curl --request POST \
--url https://api.contro.me/v1/partner/sandbox/simulate-transaction \
--header 'Content-Type: application/json' \
--header 'x-contro-api-key: <api-key>' \
--data '
{
"cardId": "card_sandbox_123",
"amount": 2500,
"currency": "USD",
"merchantName": "Test Coffee Shop",
"type": "purchase",
"originalTransactionId": "<string>"
}
'import requests
url = "https://api.contro.me/v1/partner/sandbox/simulate-transaction"
payload = {
"cardId": "card_sandbox_123",
"amount": 2500,
"currency": "USD",
"merchantName": "Test Coffee Shop",
"type": "purchase",
"originalTransactionId": "<string>"
}
headers = {
"x-contro-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-contro-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cardId: 'card_sandbox_123',
amount: 2500,
currency: 'USD',
merchantName: 'Test Coffee Shop',
type: 'purchase',
originalTransactionId: '<string>'
})
};
fetch('https://api.contro.me/v1/partner/sandbox/simulate-transaction', 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.contro.me/v1/partner/sandbox/simulate-transaction",
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' => 'card_sandbox_123',
'amount' => 2500,
'currency' => 'USD',
'merchantName' => 'Test Coffee Shop',
'type' => 'purchase',
'originalTransactionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-contro-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://api.contro.me/v1/partner/sandbox/simulate-transaction"
payload := strings.NewReader("{\n \"cardId\": \"card_sandbox_123\",\n \"amount\": 2500,\n \"currency\": \"USD\",\n \"merchantName\": \"Test Coffee Shop\",\n \"type\": \"purchase\",\n \"originalTransactionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-contro-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.contro.me/v1/partner/sandbox/simulate-transaction")
.header("x-contro-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"card_sandbox_123\",\n \"amount\": 2500,\n \"currency\": \"USD\",\n \"merchantName\": \"Test Coffee Shop\",\n \"type\": \"purchase\",\n \"originalTransactionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contro.me/v1/partner/sandbox/simulate-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-contro-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"card_sandbox_123\",\n \"amount\": 2500,\n \"currency\": \"USD\",\n \"merchantName\": \"Test Coffee Shop\",\n \"type\": \"purchase\",\n \"originalTransactionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transactionId": "<string>",
"amount": 123,
"currency": "<string>",
"status": "<string>"
}Authorizations
Partner API key (sk_live_* for production, sk_test_* for sandbox)
Body
application/json
ID of the sandbox card
Minimum string length:
1Example:
"card_sandbox_123"
Transaction amount in minor units (cents)
Example:
2500
ISO 4217 currency code
Example:
"USD"
Simulated merchant name
Example:
"Test Coffee Shop"
purchase settles spend against the sandbox balance; refund credits back a prior simulated purchase
Available options:
purchase, refund Required for refunds: the transactionId of the simulated purchase to refund
Minimum string length:
1