Update a mobile money customer
curl --request PATCH \
--url https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "<string>",
"country_code": "GH, KE, NG (or ISO-3: GHA, KEN, NGA)",
"network": "MPESA or MTN or AIRTEL or VODAFONE",
"account_name": "<string>",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"id_number": "123456789",
"image": "<string>",
"email": "john.doe@example.com"
}
'import requests
url = "https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}"
payload = {
"phone_number": "<string>",
"country_code": "GH, KE, NG (or ISO-3: GHA, KEN, NGA)",
"network": "MPESA or MTN or AIRTEL or VODAFONE",
"account_name": "<string>",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"id_number": "123456789",
"image": "<string>",
"email": "john.doe@example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
country_code: 'GH, KE, NG (or ISO-3: GHA, KEN, NGA)',
network: 'MPESA or MTN or AIRTEL or VODAFONE',
account_name: '<string>',
first_name: 'John',
last_name: 'Doe',
date_of_birth: '1990-01-01',
id_number: '123456789',
image: '<string>',
email: 'john.doe@example.com'
})
};
fetch('https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}', 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://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '<string>',
'country_code' => 'GH, KE, NG (or ISO-3: GHA, KEN, NGA)',
'network' => 'MPESA or MTN or AIRTEL or VODAFONE',
'account_name' => '<string>',
'first_name' => 'John',
'last_name' => 'Doe',
'date_of_birth' => '1990-01-01',
'id_number' => '123456789',
'image' => '<string>',
'email' => 'john.doe@example.com'
]),
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://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"country_code\": \"GH, KE, NG (or ISO-3: GHA, KEN, NGA)\",\n \"network\": \"MPESA or MTN or AIRTEL or VODAFONE\",\n \"account_name\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"date_of_birth\": \"1990-01-01\",\n \"id_number\": \"123456789\",\n \"image\": \"<string>\",\n \"email\": \"john.doe@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"country_code\": \"GH, KE, NG (or ISO-3: GHA, KEN, NGA)\",\n \"network\": \"MPESA or MTN or AIRTEL or VODAFONE\",\n \"account_name\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"date_of_birth\": \"1990-01-01\",\n \"id_number\": \"123456789\",\n \"image\": \"<string>\",\n \"email\": \"john.doe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"country_code\": \"GH, KE, NG (or ISO-3: GHA, KEN, NGA)\",\n \"network\": \"MPESA or MTN or AIRTEL or VODAFONE\",\n \"account_name\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"date_of_birth\": \"1990-01-01\",\n \"id_number\": \"123456789\",\n \"image\": \"<string>\",\n \"email\": \"john.doe@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Bio Data has been successfully updated.",
"data": {
"phone_number": "<string>",
"country_code": "GH, KE, NG (or ISO-3: GHA, KEN, NGA)",
"id": "<string>",
"network": "MPESA or MTN or AIRTEL or VODAFONE",
"customer_key": "<string>",
"account_name": "<string>",
"integrator": "<string>",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"id_number": "123456789",
"image": "<string>",
"email": "john.doe@example.com"
}
}{
"success": false,
"message": "Invalid Api Key",
"data": {}
}{
"success": false,
"message": "Not Found",
"data": {}
}Customer Management
Update Mobile Money Customer
An integrator can use this endpoint to update the customers who will be either receiving or sending money using mobile money.
PATCH
/
api
/
v3
/
customer
/
mobile-money
/
{customer_key}
Update a mobile money customer
curl --request PATCH \
--url https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "<string>",
"country_code": "GH, KE, NG (or ISO-3: GHA, KEN, NGA)",
"network": "MPESA or MTN or AIRTEL or VODAFONE",
"account_name": "<string>",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"id_number": "123456789",
"image": "<string>",
"email": "john.doe@example.com"
}
'import requests
url = "https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}"
payload = {
"phone_number": "<string>",
"country_code": "GH, KE, NG (or ISO-3: GHA, KEN, NGA)",
"network": "MPESA or MTN or AIRTEL or VODAFONE",
"account_name": "<string>",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"id_number": "123456789",
"image": "<string>",
"email": "john.doe@example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
country_code: 'GH, KE, NG (or ISO-3: GHA, KEN, NGA)',
network: 'MPESA or MTN or AIRTEL or VODAFONE',
account_name: '<string>',
first_name: 'John',
last_name: 'Doe',
date_of_birth: '1990-01-01',
id_number: '123456789',
image: '<string>',
email: 'john.doe@example.com'
})
};
fetch('https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}', 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://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '<string>',
'country_code' => 'GH, KE, NG (or ISO-3: GHA, KEN, NGA)',
'network' => 'MPESA or MTN or AIRTEL or VODAFONE',
'account_name' => '<string>',
'first_name' => 'John',
'last_name' => 'Doe',
'date_of_birth' => '1990-01-01',
'id_number' => '123456789',
'image' => '<string>',
'email' => 'john.doe@example.com'
]),
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://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"country_code\": \"GH, KE, NG (or ISO-3: GHA, KEN, NGA)\",\n \"network\": \"MPESA or MTN or AIRTEL or VODAFONE\",\n \"account_name\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"date_of_birth\": \"1990-01-01\",\n \"id_number\": \"123456789\",\n \"image\": \"<string>\",\n \"email\": \"john.doe@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"country_code\": \"GH, KE, NG (or ISO-3: GHA, KEN, NGA)\",\n \"network\": \"MPESA or MTN or AIRTEL or VODAFONE\",\n \"account_name\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"date_of_birth\": \"1990-01-01\",\n \"id_number\": \"123456789\",\n \"image\": \"<string>\",\n \"email\": \"john.doe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.kotanipay.io/api/v3/customer/mobile-money/{customer_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"country_code\": \"GH, KE, NG (or ISO-3: GHA, KEN, NGA)\",\n \"network\": \"MPESA or MTN or AIRTEL or VODAFONE\",\n \"account_name\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"date_of_birth\": \"1990-01-01\",\n \"id_number\": \"123456789\",\n \"image\": \"<string>\",\n \"email\": \"john.doe@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Bio Data has been successfully updated.",
"data": {
"phone_number": "<string>",
"country_code": "GH, KE, NG (or ISO-3: GHA, KEN, NGA)",
"id": "<string>",
"network": "MPESA or MTN or AIRTEL or VODAFONE",
"customer_key": "<string>",
"account_name": "<string>",
"integrator": "<string>",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"id_number": "123456789",
"image": "<string>",
"email": "john.doe@example.com"
}
}{
"success": false,
"message": "Invalid Api Key",
"data": {}
}{
"success": false,
"message": "Not Found",
"data": {}
}An integrator can use this endpoint to update the customers who will be either receiving or sending money using mobile money.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Country code in ISO-2 format (accepts ISO-3 and auto-converts)
Example:
"GH, KE, NG (or ISO-3: GHA, KEN, NGA)"
Available options:
MTN, AIRTEL, VODAFONE, TIGO, YAS, ORANGE, NOT_SUPPORTED, ZAMTEL, MPESA, CHECKOUT, BKTRX, CRDTRX, MOOV, TMONEY, FREE, EXPRESSO, HALOPESA, VODACOM, WAVE Example:
"MPESA or MTN or AIRTEL or VODAFONE"
Example:
"John"
Example:
"Doe"
Example:
"1990-01-01"
Example:
"123456789"
Available options:
NATIONAL_ID, ECOWAS_ID Example:
"john.doe@example.com"
⌘I