Create Wallet
curl --request POST \
--url https://waas-staging.embedly.ng/api/v1/wallets/add \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "<string>",
"currencyId": "<string>",
"name": "<string>"
}
'import requests
url = "https://waas-staging.embedly.ng/api/v1/wallets/add"
payload = {
"customerId": "<string>",
"currencyId": "<string>",
"name": "<string>"
}
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: '<string>', currencyId: '<string>', name: '<string>'})
};
fetch('https://waas-staging.embedly.ng/api/v1/wallets/add', 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://waas-staging.embedly.ng/api/v1/wallets/add",
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>',
'currencyId' => '<string>',
'name' => '<string>'
]),
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://waas-staging.embedly.ng/api/v1/wallets/add"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"name\": \"<string>\"\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://waas-staging.embedly.ng/api/v1/wallets/add")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waas-staging.embedly.ng/api/v1/wallets/add")
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\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Wallet created successfully.",
"walletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"virtualAccount": {
"accountNumber": "9710000498",
"bankCode": "232",
"bankName": "Sterling"
},
"mobNum": "2345678880"
}
{
"code": "404",
"success": false,
"message": "Customer not found",
"data": null
}
{
"code": "500",
"success": false,
"message": "An unexpected error occurred",
"data": null
}
Wallet
Create Wallet
The endpoint is designed to create a new wallet for a customer.
POST
/
wallets
/
add
Create Wallet
curl --request POST \
--url https://waas-staging.embedly.ng/api/v1/wallets/add \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "<string>",
"currencyId": "<string>",
"name": "<string>"
}
'import requests
url = "https://waas-staging.embedly.ng/api/v1/wallets/add"
payload = {
"customerId": "<string>",
"currencyId": "<string>",
"name": "<string>"
}
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: '<string>', currencyId: '<string>', name: '<string>'})
};
fetch('https://waas-staging.embedly.ng/api/v1/wallets/add', 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://waas-staging.embedly.ng/api/v1/wallets/add",
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>',
'currencyId' => '<string>',
'name' => '<string>'
]),
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://waas-staging.embedly.ng/api/v1/wallets/add"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"name\": \"<string>\"\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://waas-staging.embedly.ng/api/v1/wallets/add")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waas-staging.embedly.ng/api/v1/wallets/add")
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\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Wallet created successfully.",
"walletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"virtualAccount": {
"accountNumber": "9710000498",
"bankCode": "232",
"bankName": "Sterling"
},
"mobNum": "2345678880"
}
{
"code": "404",
"success": false,
"message": "Customer not found",
"data": null
}
{
"code": "500",
"success": false,
"message": "An unexpected error occurred",
"data": null
}
To improve performance on your system, upon successful creation of a wallet
in favour of a customer, the returned walletId, accountNumber and bankCode
should be stored in your database
Request Body
The ID of the customer who owns this wallet. (Must be a UUID) Example:
“3fa85f64-5717-4562-b3fc-2c963f66afa6”
ID of the currency for this wallet. (Must be a UUID) Example:
“3fa85f64-5717-4562-b3fc-2c963f66afa6”
The value should be gotten from the get currency endpoint in the wallet utils sectionName of the wallet or wallet owner. Example: “Emmanuel Emah”
{
"message": "Wallet created successfully.",
"walletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"virtualAccount": {
"accountNumber": "9710000498",
"bankCode": "232",
"bankName": "Sterling"
},
"mobNum": "2345678880"
}
{
"code": "404",
"success": false,
"message": "Customer not found",
"data": null
}
{
"code": "500",
"success": false,
"message": "An unexpected error occurred",
"data": null
}
⌘I