Get Settlement Accounts
curl --request GET \
--url https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll', 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://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"merchantAccountNumber": 35253486,
"accountId": 1,
"accountName": "Test Account 1",
"accountNumber": "114453647",
"connectorId": 550044,
"connectorName": "National Bank of Malawi",
"isActive": true,
"dateCreated": "2024-01-15T10:30:00Z",
"dateCaptured": "2024-01-15T10:30:00Z",
"capturedBy": "admin@example.com",
"dateModified": "2024-01-16T14:20:00Z",
"modifiedBy": "user@example.com"
},
{
"merchantAccountNumber": 35253486,
"accountId": 2,
"accountName": "Test Account 2",
"accountNumber": "3114453648",
"connectorId": 666473,
"connectorName": "FDH Bank Limited",
"isActive": false,
"dateCreated": "2024-01-20T09:15:00Z",
"dateCaptured": "2024-01-20T09:15:00Z",
"capturedBy": "admin@example.com",
"dateModified": null,
"modifiedBy": null
}
]"<string>"Settlement Accounts
Get Settlement Accounts
This endpoint retrieves all bank accounts associated with a specific merchant account.The merchant settlement bank account is where your funds are transferred after the settlement process. Only one bank account is required to be active for receiving settlements.
GET
/
merchants
/
bankAccounts
/
getAll
Get Settlement Accounts
curl --request GET \
--url https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll', 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://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.onekhusa.com/sandbox/v1/merchants/bankAccounts/getAll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"merchantAccountNumber": 35253486,
"accountId": 1,
"accountName": "Test Account 1",
"accountNumber": "114453647",
"connectorId": 550044,
"connectorName": "National Bank of Malawi",
"isActive": true,
"dateCreated": "2024-01-15T10:30:00Z",
"dateCaptured": "2024-01-15T10:30:00Z",
"capturedBy": "admin@example.com",
"dateModified": "2024-01-16T14:20:00Z",
"modifiedBy": "user@example.com"
},
{
"merchantAccountNumber": 35253486,
"accountId": 2,
"accountName": "Test Account 2",
"accountNumber": "3114453648",
"connectorId": 666473,
"connectorName": "FDH Bank Limited",
"isActive": false,
"dateCreated": "2024-01-20T09:15:00Z",
"dateCaptured": "2024-01-20T09:15:00Z",
"capturedBy": "admin@example.com",
"dateModified": null,
"modifiedBy": null
}
]"<string>"Authorizations
Bearer authentication header of the form Bearer Token, Where accessToken is the access token used to authenticate the request.
Headers
Preferred language for the response
Query Parameters
The unique identifier of the merchant account
Required range:
10000000 <= x <= 99999999Example:
35253486
Response
Success Response (200)
βI