curl -X POST "https://api.onekhusa.com/sandbox/v1/merchants/accounts/update" \
--header "Authorization: Bearer your-jwt-token" \
--header "Content-Type: application/json" \
--header "Accept-Language: en" \
-d '{
"accountName": "SkyLink Aviation Services",
"currencyCode": "MWK",
"categoryCode": "8352",
"postalAddress": "P.O. Box 30245, Lilongwe, Malawi",
"collectionFeeRuleCode": "CC",
"disbursementFeeRuleCode": "CM",
"organisationId": "FYH0NTVW0DXK",
"levelNumber": 3,
"capturedBy": "admin@onekhusa.com",
"merchantAccountNumber": 35253486
}'import requests
url = "https://api.onekhusa.com/sandbox/v1/merchants/accounts/update"
payload = {
"accountName": "SkyLink Aviation Services",
"currencyCode": "MWK",
"categoryCode": "8352",
"postalAddress": "P.O. Box 30245, Lilongwe, Malawi",
"collectionFeeRuleCode": "CC",
"disbursementFeeRuleCode": "CM",
"organisationId": "FYH0NTVW0DXK",
"levelNumber": 3,
"capturedBy": "admin@onekhusa.com",
"merchantAccountNumber": 35253486
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountName: 'SkyLink Aviation Services',
currencyCode: 'MWK',
categoryCode: '8352',
postalAddress: 'P.O. Box 30245, Lilongwe, Malawi',
collectionFeeRuleCode: 'CC',
disbursementFeeRuleCode: 'CM',
organisationId: 'FYH0NTVW0DXK',
levelNumber: 3,
capturedBy: 'admin@onekhusa.com',
merchantAccountNumber: 35253486
})
};
fetch('https://api.onekhusa.com/sandbox/v1/merchants/accounts/update', 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.onekhusa.com/sandbox/v1/merchants/accounts/update",
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([
'accountName' => 'SkyLink Aviation Services',
'currencyCode' => 'MWK',
'categoryCode' => '8352',
'postalAddress' => 'P.O. Box 30245, Lilongwe, Malawi',
'collectionFeeRuleCode' => 'CC',
'disbursementFeeRuleCode' => 'CM',
'organisationId' => 'FYH0NTVW0DXK',
'levelNumber' => 3,
'capturedBy' => 'admin@onekhusa.com',
'merchantAccountNumber' => 35253486
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.onekhusa.com/sandbox/v1/merchants/accounts/update"
payload := strings.NewReader("{\n \"accountName\": \"SkyLink Aviation Services\",\n \"currencyCode\": \"MWK\",\n \"categoryCode\": \"8352\",\n \"postalAddress\": \"P.O. Box 30245, Lilongwe, Malawi\",\n \"collectionFeeRuleCode\": \"CC\",\n \"disbursementFeeRuleCode\": \"CM\",\n \"organisationId\": \"FYH0NTVW0DXK\",\n \"levelNumber\": 3,\n \"capturedBy\": \"admin@onekhusa.com\",\n \"merchantAccountNumber\": 35253486\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.onekhusa.com/sandbox/v1/merchants/accounts/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountName\": \"SkyLink Aviation Services\",\n \"currencyCode\": \"MWK\",\n \"categoryCode\": \"8352\",\n \"postalAddress\": \"P.O. Box 30245, Lilongwe, Malawi\",\n \"collectionFeeRuleCode\": \"CC\",\n \"disbursementFeeRuleCode\": \"CM\",\n \"organisationId\": \"FYH0NTVW0DXK\",\n \"levelNumber\": 3,\n \"capturedBy\": \"admin@onekhusa.com\",\n \"merchantAccountNumber\": 35253486\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onekhusa.com/sandbox/v1/merchants/accounts/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountName\": \"SkyLink Aviation Services\",\n \"currencyCode\": \"MWK\",\n \"categoryCode\": \"8352\",\n \"postalAddress\": \"P.O. Box 30245, Lilongwe, Malawi\",\n \"collectionFeeRuleCode\": \"CC\",\n \"disbursementFeeRuleCode\": \"CM\",\n \"organisationId\": \"FYH0NTVW0DXK\",\n \"levelNumber\": 3,\n \"capturedBy\": \"admin@onekhusa.com\",\n \"merchantAccountNumber\": 35253486\n}"
response = http.request(request)
puts response.read_body"Merchant has been updated successfully"Update Merchant
This endpoint updates an existing merchant account details.
curl -X POST "https://api.onekhusa.com/sandbox/v1/merchants/accounts/update" \
--header "Authorization: Bearer your-jwt-token" \
--header "Content-Type: application/json" \
--header "Accept-Language: en" \
-d '{
"accountName": "SkyLink Aviation Services",
"currencyCode": "MWK",
"categoryCode": "8352",
"postalAddress": "P.O. Box 30245, Lilongwe, Malawi",
"collectionFeeRuleCode": "CC",
"disbursementFeeRuleCode": "CM",
"organisationId": "FYH0NTVW0DXK",
"levelNumber": 3,
"capturedBy": "admin@onekhusa.com",
"merchantAccountNumber": 35253486
}'import requests
url = "https://api.onekhusa.com/sandbox/v1/merchants/accounts/update"
payload = {
"accountName": "SkyLink Aviation Services",
"currencyCode": "MWK",
"categoryCode": "8352",
"postalAddress": "P.O. Box 30245, Lilongwe, Malawi",
"collectionFeeRuleCode": "CC",
"disbursementFeeRuleCode": "CM",
"organisationId": "FYH0NTVW0DXK",
"levelNumber": 3,
"capturedBy": "admin@onekhusa.com",
"merchantAccountNumber": 35253486
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountName: 'SkyLink Aviation Services',
currencyCode: 'MWK',
categoryCode: '8352',
postalAddress: 'P.O. Box 30245, Lilongwe, Malawi',
collectionFeeRuleCode: 'CC',
disbursementFeeRuleCode: 'CM',
organisationId: 'FYH0NTVW0DXK',
levelNumber: 3,
capturedBy: 'admin@onekhusa.com',
merchantAccountNumber: 35253486
})
};
fetch('https://api.onekhusa.com/sandbox/v1/merchants/accounts/update', 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.onekhusa.com/sandbox/v1/merchants/accounts/update",
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([
'accountName' => 'SkyLink Aviation Services',
'currencyCode' => 'MWK',
'categoryCode' => '8352',
'postalAddress' => 'P.O. Box 30245, Lilongwe, Malawi',
'collectionFeeRuleCode' => 'CC',
'disbursementFeeRuleCode' => 'CM',
'organisationId' => 'FYH0NTVW0DXK',
'levelNumber' => 3,
'capturedBy' => 'admin@onekhusa.com',
'merchantAccountNumber' => 35253486
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.onekhusa.com/sandbox/v1/merchants/accounts/update"
payload := strings.NewReader("{\n \"accountName\": \"SkyLink Aviation Services\",\n \"currencyCode\": \"MWK\",\n \"categoryCode\": \"8352\",\n \"postalAddress\": \"P.O. Box 30245, Lilongwe, Malawi\",\n \"collectionFeeRuleCode\": \"CC\",\n \"disbursementFeeRuleCode\": \"CM\",\n \"organisationId\": \"FYH0NTVW0DXK\",\n \"levelNumber\": 3,\n \"capturedBy\": \"admin@onekhusa.com\",\n \"merchantAccountNumber\": 35253486\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.onekhusa.com/sandbox/v1/merchants/accounts/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountName\": \"SkyLink Aviation Services\",\n \"currencyCode\": \"MWK\",\n \"categoryCode\": \"8352\",\n \"postalAddress\": \"P.O. Box 30245, Lilongwe, Malawi\",\n \"collectionFeeRuleCode\": \"CC\",\n \"disbursementFeeRuleCode\": \"CM\",\n \"organisationId\": \"FYH0NTVW0DXK\",\n \"levelNumber\": 3,\n \"capturedBy\": \"admin@onekhusa.com\",\n \"merchantAccountNumber\": 35253486\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onekhusa.com/sandbox/v1/merchants/accounts/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountName\": \"SkyLink Aviation Services\",\n \"currencyCode\": \"MWK\",\n \"categoryCode\": \"8352\",\n \"postalAddress\": \"P.O. Box 30245, Lilongwe, Malawi\",\n \"collectionFeeRuleCode\": \"CC\",\n \"disbursementFeeRuleCode\": \"CM\",\n \"organisationId\": \"FYH0NTVW0DXK\",\n \"levelNumber\": 3,\n \"capturedBy\": \"admin@onekhusa.com\",\n \"merchantAccountNumber\": 35253486\n}"
response = http.request(request)
puts response.read_body"Merchant has been updated successfully"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
Body
The unique identifier of the merchant account to update
35253486
The updated name of the merchant account
"SkyLink Aviation Services"
The updated currency code (can only be changed if merchant has no transactions)
"MWK"
The category a merchant account belongs to i.e. Aviation
"8352"
The postal address of the merchant
"P.O. Box 30245, Lilongwe, Malawi"
The rule code to apply when charging the transaction fee on collection payment whether should be borne by the merchant or customer
"CC"
The rule code to apply when charging the transaction fee on disbursement (payout) payment whether should be borne by the merchant or customer
"CM"
The unique identifier of the organization
"FYH0NTVW0DXK"
Email address of the user updating the merchant
"admin@onekhusa.com"
The updated level number for the merchant. See Get Authorization Levels for available levels.
3
Response
OK - Merchant successfully updated
The response is of type string.
"Merchant has been updated successfully"