Developer Sandbox · v1.0
A complete routing simulator for the RouteSense API.
Test every transaction type — sale, auth, capture, void, refund — across NMI, Stripe, Adyen, Authorize.Net, and Airwallex. Run the full Pathfinder rule engine against realistic BIN data, with first-class observability into every routing decision.
01 —
Quick start
01
Generate a token
Open the API Explorer, paste your 36-char merchant UUID, and tap Generate Token.
merchant_id → security_key
02
Pick a gateway
Auto routes via Pathfinder. Or pin to NMI, Stripe, Adyen, Authorize.Net, or Airwallex.
gateway = stripe
03
Send a transaction
Use a test card or paste your own. Watch routing rules fire in real time.
POST /api/transact
02 —
Response codes
1
Approved
Transaction authorized by the gateway. Returns transactionid, authcode, AVS/CVV results.
2
Declined
Issuer or gateway declined. Inspect response_code (200–299) for the specific reason.
3
Error
Validation, configuration, or pre-gateway block. Often surfaced by a routing rule.
03 —
Integration flow
01
Generate your security token
Your merchant account ID is a 36-character UUID provisioned during onboarding. In the Explorer, enter it and click Generate Token — the sandbox calls the RouteSense token service which returns a security key valid for all subsequent requests on this merchant.
POST token.sandbox.routesense.ai/api/v1/token/generate { merchant_id: "550e8400-..." }
02
Send a transaction
POST to https://router.sandbox.routesense.ai/api/transact with Content-Type: application/x-www-form-urlencoded. Include type, amount, and card fields.
type=sale&amount=49.99&ccnumber=4242...&ccexp=1228&cvv=123
03
Parse the response
Responses are URL-encoded key=value pairs. Check response: 1=approved, 2=declined, 3=error. Store transactionid for capture/void/refund.
response=1&responsetext=SUCCESS&transactionid=xxx&authcode=ABC123
04
Capture, void, or refund
Use the transactionid from the original response to perform downstream operations. Auth-only flows require an explicit capture.
type=capture&transactionid=PREVIOUS_TXN_ID
04 —
Request fields
Field Required Description Example
security_key Required RouteSense merchant token, generated from your merchant UUID via the token service. AUX7Yw...
type Required Transaction type: auth, sale, capture, void, refund. sale
amount Conditional Decimal with two places. Required for auth, sale, refund. 49.99
ccnumber Conditional Card number, no spaces or dashes. Required for auth and sale. 4242424242424242
ccexp Conditional Expiry in MMYY format. Required for auth and sale. 1228
cvv Optional 3–4 digit verification value. Strongly recommended. 123
transactionid Conditional Returned ID from a prior approval. Required for capture, void, refund. 11325689772
currency Optional ISO 4217 code. Defaults to USD. USD
orderid Optional Your internal order identifier. ORD-001
first_name Optional Cardholder first name. John
last_name Optional Cardholder last name. Smith
email Optional Customer email for receipts. john[at]example.com
billing_* Optional Any field prefixed with billing_ is passed through. billing_city=Austin
shipping_* Optional Any field prefixed with shipping_ is passed through. shipping_zip=78701
05 —
Response fields
Field Description Example
response Outcome: 1 Approved · 2 Declined · 3 Error 1
responsetext Human-readable description. SUCCESS
transactionid Gateway-assigned ID. Store for capture/void/refund. 11325689772
authcode Network authorization code. 123456
response_code NMI-style detail code. 100
routed_mid MID Pathfinder selected. MID-NMI-A1
routed_gateway Gateway used for this transaction. stripe
midas_score RouteSense MIDAS health score (0–100). 94
rule_id If a rule fired, its ID. Otherwise omitted. rule_eu_to_aci
router_transaction_id RouteSense internal UUID. Always present. e74c0159-dd28-…
Transaction History
Session-only. Cleared on reload.
Clear
No transactions yet this session
Time Type Amount Card Result Code Transaction ID ms
cURL
Python
Node.js
Go
PHP
Sale
curl -X POST https://router.sandbox.routesense.ai/api/transact \
-d security_key=YOUR_KEY \
-d type=sale \
-d amount=49.99 \
-d ccnumber=4242424242424242 \
-d ccexp=1228 \
-d cvv=123 \
-d first_name=John \
-d last_name=Smith \
-d orderid=ORD-001
Auth Only
curl -X POST https://router.sandbox.routesense.ai/api/transact \
-d security_key=YOUR_KEY \
-d type=auth \
-d amount=49.99 \
-d ccnumber=4242424242424242 \
-d ccexp=1228 \
-d cvv=123
Capture
curl -X POST https://router.sandbox.routesense.ai/api/transact \
-d security_key=YOUR_KEY \
-d type=capture \
-d transactionid=11325689772
Refund
curl -X POST https://router.sandbox.routesense.ai/api/transact \
-d security_key=YOUR_KEY \
-d type=refund \
-d transactionid=11325689772 \
-d amount=49.99
routesense_client.py
import requests
ENDPOINT = "https://router.sandbox.routesense.ai/api/transact"
SECURITY_KEY = "YOUR_KEY"
def parse(text):
return dict(p.split("=", 1) for p in text.split("&") if "=" in p)
result = parse(requests.post(ENDPOINT, data={
"security_key": SECURITY_KEY, "type": "sale",
"amount": "49.99",
"ccnumber": "4242424242424242",
"ccexp": "1228", "cvv": "123",
}).text)
if result["response"] == "1":
print("Approved:", result["transactionid"])
else:
print("Failed:", result["responsetext"])
routesense.js
const ENDPOINT = "https://router.sandbox.routesense.ai/api/transact";
async function transact(params) {
const body = new URLSearchParams({ security_key: "YOUR_KEY", ...params });
const res = await fetch(ENDPOINT, { method: "POST", body });
const text = await res.text();
return Object.fromEntries(new URLSearchParams(text));
}
const r = await transact({
type: "sale", amount: "49.99",
ccnumber: "4242424242424242", ccexp: "1228", cvv: "123",
});
console.log(r.response === "1" ? "Approved: " + r.transactionid : "Failed: " + r.responsetext);
routesense.go
package main
import (
"fmt"
"net/http"
"net/url"
"io"
)
const Endpoint = "https://router.sandbox.routesense.ai/api/transact"
func transact(params url.Values) (url.Values, error) {
params.Set("security_key", "YOUR_KEY")
res, err := http.PostForm(Endpoint, params)
if err != nil { return nil, err }
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
return url.ParseQuery(string(body))
}
func main() {
r, _ := transact(url.Values{
"type": {"sale"},
"amount": {"49.99"},
"ccnumber": {"4242424242424242"},
"ccexp": {"1228"},
"cvv": {"123"},
})
fmt.Println(r.Get("response"), r.Get("transactionid"))
}
routesense.php
<?php
function transact($params) {
$params['security_key'] = 'YOUR_KEY';
$ch = curl_init('https://router.sandbox.routesense.ai/api/transact');
curl_setopt_array($ch, [
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => http_build_query($params),
CURLOPT_RETURNTRANSFER => 1,
]);
parse_str(curl_exec($ch), $r);
return $r;
}
$r = transact([
'type' => 'sale', 'amount' => '49.99',
'ccnumber' => '4242424242424242',
'ccexp' => '1228', 'cvv' => '123',
]);
echo $r['response'] == '1' ? "Approved: {$r['transactionid']}" : "Failed: {$r['responsetext']}";