Simulate clearing
API reference
A single message is a message type that uses real-time verification and requires the cardholder to enter their PIN to authorize and clear their transaction. An example of a transaction that uses a single message is an ATM withdrawal.
This API can only be run in the Cross River Sandbox
Endpoint: /cardmanagement/v1/simulate/single-message-clearing
POST
https://sandbox.crbcos.com/cardmanagement/v1/simulate/single-message-clearing
Body Parameters
- processingCodestringDescription
- cardIdstringrequiredDescription
- amountintegerrequiredDescription
- merchantCountryCodestringrequiredDescription
- merchantNamestringrequiredDescription
- merchantStreetstringrequiredDescription
- merchantCitystringrequiredDescription
- merchantStatestringrequiredDescription
- merchantPostalCodestringrequiredDescription
- cardNetworkstringDescription
- additionalAmountsobjectDescription
- amountTypestringDescription
- accountTypestringDescription
- amountintegerDescription
Response
- retrievalReferenceNumberstringDescription
- cardIdstringDescription
curl
curl --location 'https://sandbox.crbcos.com/cardmanagement/v1/simulate/single-message-clearing' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"processingCode": "Purchase",
"cardId": "8c6a53e0-83ad-4b76-b446-b300006a3e6a",
"amount": "22",
"merchantCountryCode": "US",
"merchantName": "StreamFlix",
"merchantStreet": "123 Any St",
"merchantCity": "Anywhere",
"merchantState": "NY",
"merchantPostalCode": "10001",
"cardNetwork": "Visa",
"additionalAmounts": [
{
"amountType": "Unknown",
"accountType": "NotSpecified",
"amount": "10"
}
]
}
'nodejs
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'sandbox.crbcos.com',
'path': '/cardmanagement/v1/simulate/single-message-clearing',
'headers': {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = "{\r\n \"processingCode\": \"Purchase\",\r\n \"cardId\": \"8c6a53e0-83ad-4b76-b446-b300006a3e6a\",\r\n \"amount\": \"22\",\r\n \"merchantCountryCode\": \"US\",\r\n \"merchantName\": \"StreamFlix\",\r\n \"merchantStreet\": \"123 Any St\",\r\n \"merchantCity\": \"Anywhere\",\r\n \"merchantState\": \"NY\",\r\n \"merchantPostalCode\": \"10001\",\r\n \"cardNetwork\": \"Visa\",\r\n \"additionalAmounts\": [\r\n {\r\n \"amountType\": \"Unknown\",\r\n \"accountType\": \"NotSpecified\",\r\n \"amount\": \"10\"\r\n }\r\n ]\r\n}\r\n\r\n";
req.write(postData);
req.end();python
import requests
url = "https://sandbox.crbcos.com/cardmanagement/v1/simulate/single-message-clearing"
payload = "{\r\n \"processingCode\": \"Purchase\",\r\n \"cardId\": \"8c6a53e0-83ad-4b76-b446-b300006a3e6a\",\r\n \"amount\": \"22\",\r\n \"merchantCountryCode\": \"US\",\r\n \"merchantName\": \"StreamFlix\",\r\n \"merchantStreet\": \"123 Any St\",\r\n \"merchantCity\": \"Anywhere\",\r\n \"merchantState\": \"NY\",\r\n \"merchantPostalCode\": \"10001\",\r\n \"cardNetwork\": \"Visa\",\r\n \"additionalAmounts\": [\r\n {\r\n \"amountType\": \"Unknown\",\r\n \"accountType\": \"NotSpecified\",\r\n \"amount\": \"10\"\r\n }\r\n ]\r\n}\r\n\r\n"
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "net/http"
url = URI("https://sandbox.crbcos.com/cardmanagement/v1/simulate/single-message-clearing")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = "{\r\n \"processingCode\": \"Purchase\",\r\n \"cardId\": \"8c6a53e0-83ad-4b76-b446-b300006a3e6a\",\r\n \"amount\": \"22\",\r\n \"merchantCountryCode\": \"US\",\r\n \"merchantName\": \"StreamFlix\",\r\n \"merchantStreet\": \"123 Any St\",\r\n \"merchantCity\": \"Anywhere\",\r\n \"merchantState\": \"NY\",\r\n \"merchantPostalCode\": \"10001\",\r\n \"cardNetwork\": \"Visa\",\r\n \"additionalAmounts\": [\r\n {\r\n \"amountType\": \"Unknown\",\r\n \"accountType\": \"NotSpecified\",\r\n \"amount\": \"10\"\r\n }\r\n ]\r\n}\r\n\r\n"
response = https.request(request)
puts response.read_body
go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.crbcos.com/cardmanagement/v1/simulate/single-message-clearing"
method := "POST"
payload := strings.NewReader(`{
"processingCode": "Purchase",
"cardId": "8c6a53e0-83ad-4b76-b446-b300006a3e6a",
"amount": "22",
"merchantCountryCode": "US",
"merchantName": "StreamFlix",
"merchantStreet": "123 Any St",
"merchantCity": "Anywhere",
"merchantState": "NY",
"merchantPostalCode": "10001",
"cardNetwork": "Visa",
"additionalAmounts": [
{
"amountType": "Unknown",
"accountType": "NotSpecified",
"amount": "10"
}
]
}
`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}200
{
"retrievalReferenceNumber": "674583031323",
"cardId": "8c6a53e0-83ad-4b76-b446-b300006a3e6a"
}