Simulate Authorization
curl --request POST \
--url https://api.sandbox.sudo.cards/cards/simulator/authorization \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cardId": "<string>",
"channel": "web",
"type": "purchase",
"amount": 123,
"currency": "NGN",
"merchant": {
"category": "<string>",
"merchantId": "<string>",
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.sandbox.sudo.cards/cards/simulator/authorization"
payload = {
"cardId": "<string>",
"channel": "web",
"type": "purchase",
"amount": 123,
"currency": "NGN",
"merchant": {
"category": "<string>",
"merchantId": "<string>",
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cardId: '<string>',
channel: 'web',
type: 'purchase',
amount: 123,
currency: 'NGN',
merchant: {
category: '<string>',
merchantId: '<string>',
name: '<string>',
city: '<string>',
state: '<string>',
country: '<string>'
}
})
};
fetch('https://api.sandbox.sudo.cards/cards/simulator/authorization', 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.sandbox.sudo.cards/cards/simulator/authorization",
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' => '<string>',
'channel' => 'web',
'type' => 'purchase',
'amount' => 123,
'currency' => 'NGN',
'merchant' => [
'category' => '<string>',
'merchantId' => '<string>',
'name' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.sandbox.sudo.cards/cards/simulator/authorization"
payload := strings.NewReader("{\n \"cardId\": \"<string>\",\n \"channel\": \"web\",\n \"type\": \"purchase\",\n \"amount\": 123,\n \"currency\": \"NGN\",\n \"merchant\": {\n \"category\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.sandbox.sudo.cards/cards/simulator/authorization")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"<string>\",\n \"channel\": \"web\",\n \"type\": \"purchase\",\n \"amount\": 123,\n \"currency\": \"NGN\",\n \"merchant\": {\n \"category\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sudo.cards/cards/simulator/authorization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"<string>\",\n \"channel\": \"web\",\n \"type\": \"purchase\",\n \"amount\": 123,\n \"currency\": \"NGN\",\n \"merchant\": {\n \"category\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Simulated successfully."
}{
"statusCode": 400,
"message": "Invalid card id.",
"data": null
}{
"statusCode": 401,
"message": "Unauthorized. Provide a valid API key in the Authorization header.",
"data": null
}Simulator (Sandbox Only)
Simulate Authorization
Simulates different types of authorizations across several merchant categories and channels.
POST
/
cards
/
simulator
/
authorization
Simulate Authorization
curl --request POST \
--url https://api.sandbox.sudo.cards/cards/simulator/authorization \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cardId": "<string>",
"channel": "web",
"type": "purchase",
"amount": 123,
"currency": "NGN",
"merchant": {
"category": "<string>",
"merchantId": "<string>",
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.sandbox.sudo.cards/cards/simulator/authorization"
payload = {
"cardId": "<string>",
"channel": "web",
"type": "purchase",
"amount": 123,
"currency": "NGN",
"merchant": {
"category": "<string>",
"merchantId": "<string>",
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cardId: '<string>',
channel: 'web',
type: 'purchase',
amount: 123,
currency: 'NGN',
merchant: {
category: '<string>',
merchantId: '<string>',
name: '<string>',
city: '<string>',
state: '<string>',
country: '<string>'
}
})
};
fetch('https://api.sandbox.sudo.cards/cards/simulator/authorization', 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.sandbox.sudo.cards/cards/simulator/authorization",
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' => '<string>',
'channel' => 'web',
'type' => 'purchase',
'amount' => 123,
'currency' => 'NGN',
'merchant' => [
'category' => '<string>',
'merchantId' => '<string>',
'name' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.sandbox.sudo.cards/cards/simulator/authorization"
payload := strings.NewReader("{\n \"cardId\": \"<string>\",\n \"channel\": \"web\",\n \"type\": \"purchase\",\n \"amount\": 123,\n \"currency\": \"NGN\",\n \"merchant\": {\n \"category\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.sandbox.sudo.cards/cards/simulator/authorization")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"<string>\",\n \"channel\": \"web\",\n \"type\": \"purchase\",\n \"amount\": 123,\n \"currency\": \"NGN\",\n \"merchant\": {\n \"category\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sudo.cards/cards/simulator/authorization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"<string>\",\n \"channel\": \"web\",\n \"type\": \"purchase\",\n \"amount\": 123,\n \"currency\": \"NGN\",\n \"merchant\": {\n \"category\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Simulated successfully."
}{
"statusCode": 400,
"message": "Invalid card id.",
"data": null
}{
"statusCode": 401,
"message": "Unauthorized. Provide a valid API key in the Authorization header.",
"data": null
}Authorizations
Body
application/json
The _id of the card.
The channel to simulate the authorization on.
Available options:
web, pos, atm The authorization type.
Available options:
purchase, cash_withdrawal, deposit, transfer, payment The amount to simulate.
The currency type.
Available options:
NGN, USD The merchant information.
Show child attributes
Show child attributes
⌘I
