Create Wallet
curl --request POST \
--url https://api.example.com/api/v1/wallets/fiat/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"customerId": "<string>",
"walletName": "<string>",
"walletReference": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/wallets/fiat/create"
payload = {
"customerId": "<string>",
"walletName": "<string>",
"walletReference": "<string>"
}
headers = {
"x-api-key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({customerId: '<string>', walletName: '<string>', walletReference: '<string>'})
};
fetch('https://api.example.com/api/v1/wallets/fiat/create', 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.example.com/api/v1/wallets/fiat/create",
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' => '<string>',
'walletName' => '<string>',
'walletReference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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://api.example.com/api/v1/wallets/fiat/create"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"walletName\": \"<string>\",\n \"walletReference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.example.com/api/v1/wallets/fiat/create")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"walletName\": \"<string>\",\n \"walletReference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/wallets/fiat/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"<string>\",\n \"walletName\": \"<string>\",\n \"walletReference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Fiat wallet created successfully",
"data": {
"walletId": "wal_abc123xyz",
"bankName": "Wema Bank",
"bankCode": "035",
"accountNumber": "1234567890"
}
}
{
"success": false,
"message": "Invalid customer ID",
"code": "INVALID_CUSTOMER",
"errors": {
"customerId": "Customer ID is invalid"
}
}
Virtual Wallets
Create Wallet
Create a fiat wallet for a customer
POST
/
api
/
v1
/
wallets
/
fiat
/
create
Create Wallet
curl --request POST \
--url https://api.example.com/api/v1/wallets/fiat/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"customerId": "<string>",
"walletName": "<string>",
"walletReference": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/wallets/fiat/create"
payload = {
"customerId": "<string>",
"walletName": "<string>",
"walletReference": "<string>"
}
headers = {
"x-api-key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({customerId: '<string>', walletName: '<string>', walletReference: '<string>'})
};
fetch('https://api.example.com/api/v1/wallets/fiat/create', 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.example.com/api/v1/wallets/fiat/create",
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' => '<string>',
'walletName' => '<string>',
'walletReference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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://api.example.com/api/v1/wallets/fiat/create"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"walletName\": \"<string>\",\n \"walletReference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.example.com/api/v1/wallets/fiat/create")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"walletName\": \"<string>\",\n \"walletReference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/wallets/fiat/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"<string>\",\n \"walletName\": \"<string>\",\n \"walletReference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Fiat wallet created successfully",
"data": {
"walletId": "wal_abc123xyz",
"bankName": "Wema Bank",
"bankCode": "035",
"accountNumber": "1234567890"
}
}
{
"success": false,
"message": "Invalid customer ID",
"code": "INVALID_CUSTOMER",
"errors": {
"customerId": "Customer ID is invalid"
}
}
Request
API Key for authentication
Unique identifier for the customer
Name of the wallet
Reference for the wallet
Request Example
curl -X POST https://api-production.fossapay.com/api/v1/wallets/fiat/create \
-H "x-api-key: fp_live_sk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"customerId": "cus_123456789",
"walletName": "Main Wallet",
"walletReference": "wallet_ref_001"
}'
const response = await fetch('https://api-production.fossapay.com/api/v1/wallets/fiat/create', {
method: 'POST',
headers: {
'x-api-key': 'fp_live_sk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 'cus_123456789',
walletName: 'Main Wallet',
walletReference: 'wallet_ref_001'
})
});
const data = await response.json();
const wallet = data.data;
import requests
url = "https://api-production.fossapay.com/api/v1/wallets/fiat/create"
headers = {
"x-api-key": "fp_live_sk_xxxxxxxx",
"Content-Type": "application/json"
}
data = {
"customerId": "cus_123456789",
"walletName": "Main Wallet",
"walletReference": "wallet_ref_001"
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
wallet = data["data"]
Response
Indicates if the request was successful
Human-readable response message
Response Example
{
"success": true,
"message": "Fiat wallet created successfully",
"data": {
"walletId": "wal_abc123xyz",
"bankName": "Wema Bank",
"bankCode": "035",
"accountNumber": "1234567890"
}
}
{
"success": false,
"message": "Invalid customer ID",
"code": "INVALID_CUSTOMER",
"errors": {
"customerId": "Customer ID is invalid"
}
}
Error Codes
| Code | Description |
|---|---|
INVALID_CUSTOMER | Customer ID is invalid |
MISSING_FIELDS | Required fields are missing |
UNAUTHORIZED | Invalid API key or insufficient permissions |
Rate Limit: 100 requests per minute
Store the
walletId in your database for future reference and transaction matching.⌘I

