Simulate an Inbound Transfer
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10000, reference: 'TXN1234567'})
};
fetch('https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 10000,
"reference": "TXN1234567"
}
'import requests
url = "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer"
payload = {
"amount": 10000,
"reference": "TXN1234567"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10000, reference: 'TXN1234567'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer",
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([
'amount' => 10000,
'reference' => 'TXN1234567'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"amount": 10000,
"reference": "TXN1234567"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}")
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer"
payload := strings.NewReader("{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-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))
}{
"status": "success",
"message": "Virtual account funded successfully."
}{
"status": "error",
"errorCode": "INVALID_PARAMETER",
"message": "An error occurred."
}{
"status": "error",
"errorCode": "UNAUTHORIZED",
"message": "No valid API key provided."
}Virtual Account
Simulate Virtual Account Funding
Simulates an inbound credit transfer to a virtual account. This is a test-only endpoint.
POST
/
v1
/
virtual-account
/
simulate
/
transfer
Simulate an Inbound Transfer
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10000, reference: 'TXN1234567'})
};
fetch('https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 10000,
"reference": "TXN1234567"
}
'import requests
url = "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer"
payload = {
"amount": 10000,
"reference": "TXN1234567"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10000, reference: 'TXN1234567'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer",
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([
'amount' => 10000,
'reference' => 'TXN1234567'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"amount": 10000,
"reference": "TXN1234567"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}")
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/virtual-account/simulate/transfer"
payload := strings.NewReader("{\n \"amount\": 10000,\n \"reference\": \"TXN1234567\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-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))
}{
"status": "success",
"message": "Virtual account funded successfully."
}{
"status": "error",
"errorCode": "INVALID_PARAMETER",
"message": "An error occurred."
}{
"status": "error",
"errorCode": "UNAUTHORIZED",
"message": "No valid API key provided."
}This endpoint is a crucial tool for testing your integration in our sandbox environment 🧪. It allows you to simulate an incoming bank transfer to a specific virtual account, triggering any associated webhooks and updating the account’s balance.
This endpoint is available only in the sandbox environment and will not work in production. It is designed exclusively for testing purposes.
Endpoint
Use this endpoint to simulate a credit transaction to one of your virtual accounts.POST /v1/virtual-account/simulate/transfer
Request Body
The request body must include the amount and the unique reference of the virtual account you wish to fund.| Field | Type | Description | Required |
|---|---|---|---|
amount | Number | The amount to be credited, specified in the lowest denomination (e.g., kobo, cents). | ✅ Yes |
reference | String | The unique reference number for the virtual account you are funding. | ✅ Yes |
Request Example
Here is an example of how to call the endpoint using cURL.copy
curl --location '{{baseurl}}/v1/virtual-account/simulate/transfer' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_SANDBOX_API_KEY' \
--data '{
"amount": 10000,
"reference": "your_virtual_account_reference"
}'
curl --location '{{baseurl}}/v1/virtual-account/simulate/transfer' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{apikey}}' \
--data '{
"amount": 10000,
"reference": "{{refNumber}}"
}'
Authorizations
Body
application/json
Details of the simulated transfer.
Was this page helpful?
⌘I

