Virtual Accounts
Create virtual account
Open a dedicated (permanent) or dynamic (amount-bound, temporary) virtual account for a customer. Needs a webhook secret on the merchant account. Returns status requires_action with a nextStep when the provider needs the customer to verify first, and pending while the provider approves it.
POST
/
api
/
v1
/
virtual-accounts
Create virtual account
curl --request POST \
--url https://pay-api.pagoramp.com/api/v1/virtual-accounts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "224ca5c5-f2a6-419b-bf36-73997434d945",
"currency": "NGN",
"type": "dedicated",
"country": "NG",
"reference": "va_1001",
"metadata": {
"orderId": "12345"
},
"amount": 5000,
"expiresIn": 7200,
"redirectUrl": "https://app.example.com/verification-complete"
}
'import requests
url = "https://pay-api.pagoramp.com/api/v1/virtual-accounts"
payload = {
"customerId": "224ca5c5-f2a6-419b-bf36-73997434d945",
"currency": "NGN",
"type": "dedicated",
"country": "NG",
"reference": "va_1001",
"metadata": { "orderId": "12345" },
"amount": 5000,
"expiresIn": 7200,
"redirectUrl": "https://app.example.com/verification-complete"
}
headers = {
"x-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-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '224ca5c5-f2a6-419b-bf36-73997434d945',
currency: 'NGN',
type: 'dedicated',
country: 'NG',
reference: 'va_1001',
metadata: {orderId: '12345'},
amount: 5000,
expiresIn: 7200,
redirectUrl: 'https://app.example.com/verification-complete'
})
};
fetch('https://pay-api.pagoramp.com/api/v1/virtual-accounts', 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://pay-api.pagoramp.com/api/v1/virtual-accounts",
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([
'customerId' => '224ca5c5-f2a6-419b-bf36-73997434d945',
'currency' => 'NGN',
'type' => 'dedicated',
'country' => 'NG',
'reference' => 'va_1001',
'metadata' => [
'orderId' => '12345'
],
'amount' => 5000,
'expiresIn' => 7200,
'redirectUrl' => 'https://app.example.com/verification-complete'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pay-api.pagoramp.com/api/v1/virtual-accounts"
payload := strings.NewReader("{\n \"customerId\": \"224ca5c5-f2a6-419b-bf36-73997434d945\",\n \"currency\": \"NGN\",\n \"type\": \"dedicated\",\n \"country\": \"NG\",\n \"reference\": \"va_1001\",\n \"metadata\": {\n \"orderId\": \"12345\"\n },\n \"amount\": 5000,\n \"expiresIn\": 7200,\n \"redirectUrl\": \"https://app.example.com/verification-complete\"\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))
}HttpResponse<String> response = Unirest.post("https://pay-api.pagoramp.com/api/v1/virtual-accounts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"224ca5c5-f2a6-419b-bf36-73997434d945\",\n \"currency\": \"NGN\",\n \"type\": \"dedicated\",\n \"country\": \"NG\",\n \"reference\": \"va_1001\",\n \"metadata\": {\n \"orderId\": \"12345\"\n },\n \"amount\": 5000,\n \"expiresIn\": 7200,\n \"redirectUrl\": \"https://app.example.com/verification-complete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay-api.pagoramp.com/api/v1/virtual-accounts")
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 \"customerId\": \"224ca5c5-f2a6-419b-bf36-73997434d945\",\n \"currency\": \"NGN\",\n \"type\": \"dedicated\",\n \"country\": \"NG\",\n \"reference\": \"va_1001\",\n \"metadata\": {\n \"orderId\": \"12345\"\n },\n \"amount\": 5000,\n \"expiresIn\": 7200,\n \"redirectUrl\": \"https://app.example.com/verification-complete\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Body
application/json
The customer uuid
Example:
"224ca5c5-f2a6-419b-bf36-73997434d945"
NGN, CAD, USD, EUR, GBP, KES, GHS or TZS
Example:
"NGN"
Available options:
dedicated, dynamic Example:
"dedicated"
Example:
"NG"
Your own reference, unique per merchant
Example:
"va_1001"
Example:
{ "orderId": "12345" }
Dynamic accounts only: the amount the payer must send
Example:
5000
Dynamic accounts only: seconds until the account expires
Example:
7200
Where the customer returns after a hosted verification step (USD, EUR, GBP)
Example:
"https://app.example.com/verification-complete"
Response
Create virtual account
curl --request POST \
--url https://pay-api.pagoramp.com/api/v1/virtual-accounts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "224ca5c5-f2a6-419b-bf36-73997434d945",
"currency": "NGN",
"type": "dedicated",
"country": "NG",
"reference": "va_1001",
"metadata": {
"orderId": "12345"
},
"amount": 5000,
"expiresIn": 7200,
"redirectUrl": "https://app.example.com/verification-complete"
}
'import requests
url = "https://pay-api.pagoramp.com/api/v1/virtual-accounts"
payload = {
"customerId": "224ca5c5-f2a6-419b-bf36-73997434d945",
"currency": "NGN",
"type": "dedicated",
"country": "NG",
"reference": "va_1001",
"metadata": { "orderId": "12345" },
"amount": 5000,
"expiresIn": 7200,
"redirectUrl": "https://app.example.com/verification-complete"
}
headers = {
"x-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-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '224ca5c5-f2a6-419b-bf36-73997434d945',
currency: 'NGN',
type: 'dedicated',
country: 'NG',
reference: 'va_1001',
metadata: {orderId: '12345'},
amount: 5000,
expiresIn: 7200,
redirectUrl: 'https://app.example.com/verification-complete'
})
};
fetch('https://pay-api.pagoramp.com/api/v1/virtual-accounts', 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://pay-api.pagoramp.com/api/v1/virtual-accounts",
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([
'customerId' => '224ca5c5-f2a6-419b-bf36-73997434d945',
'currency' => 'NGN',
'type' => 'dedicated',
'country' => 'NG',
'reference' => 'va_1001',
'metadata' => [
'orderId' => '12345'
],
'amount' => 5000,
'expiresIn' => 7200,
'redirectUrl' => 'https://app.example.com/verification-complete'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pay-api.pagoramp.com/api/v1/virtual-accounts"
payload := strings.NewReader("{\n \"customerId\": \"224ca5c5-f2a6-419b-bf36-73997434d945\",\n \"currency\": \"NGN\",\n \"type\": \"dedicated\",\n \"country\": \"NG\",\n \"reference\": \"va_1001\",\n \"metadata\": {\n \"orderId\": \"12345\"\n },\n \"amount\": 5000,\n \"expiresIn\": 7200,\n \"redirectUrl\": \"https://app.example.com/verification-complete\"\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))
}HttpResponse<String> response = Unirest.post("https://pay-api.pagoramp.com/api/v1/virtual-accounts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"224ca5c5-f2a6-419b-bf36-73997434d945\",\n \"currency\": \"NGN\",\n \"type\": \"dedicated\",\n \"country\": \"NG\",\n \"reference\": \"va_1001\",\n \"metadata\": {\n \"orderId\": \"12345\"\n },\n \"amount\": 5000,\n \"expiresIn\": 7200,\n \"redirectUrl\": \"https://app.example.com/verification-complete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay-api.pagoramp.com/api/v1/virtual-accounts")
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 \"customerId\": \"224ca5c5-f2a6-419b-bf36-73997434d945\",\n \"currency\": \"NGN\",\n \"type\": \"dedicated\",\n \"country\": \"NG\",\n \"reference\": \"va_1001\",\n \"metadata\": {\n \"orderId\": \"12345\"\n },\n \"amount\": 5000,\n \"expiresIn\": 7200,\n \"redirectUrl\": \"https://app.example.com/verification-complete\"\n}"
response = http.request(request)
puts response.read_body
