Mobile Payins
Introduction
The Mobile Payments API enables you to accept and send payments seamlessly through mobile money wallets across 35+ countries.
With a single, unified endpoint you can:
- Collections (Payins): Accept payments from customers’ mobile wallets into your merchant account.
This API removes the complexity of managing multiple providers, giving you a reliable way to scale collections and payouts globally.
Endpoint
POST https://api.mypayd.app/api/v3/payments
Authorization
Every request must include authentication headers:
AUTHORIZATION: Basic Auth
Username <username>
Password <password>
Request Body
The request body should include the necessary parameters for the transaction. We will need to add the customer Information to pick the customer KYC.
basic title:"json"
{
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "momo",
"account_number": "+254712345678",
"amount": 50,
"phone_number": "07712345678",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"customer_info": {
"country": "Ghana",
"address": "123 Independence Ave, Accra",
"id_type": "Passport",
"phone": "+2331245678",
"dob": "1990-05-15",
"name": "John Doe",
"id_number": "GHA123456789",
"email": "johndoe@example.com"
}
}
Below are code examples in different programming languages demonstrating how to receive payments from different mobile payments worldwide.
- Curl
- Go
- Nodejs
- python
- PHP
curl --location 'https://api.mypayd.app/api/v3/payments'
--data-raw '{
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "John Doe",
"account_number": "+254712434671",
"amount": 100,
"phone_number": "07712345671",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Event Ticket Purchase",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"customer_info": {
"country": "Ghana",
"address": "123 Independence Ave, Accra",
"id_type": "Passport",
"phone": "+23312345678",
"dob": "1990-05-15",
"name": "John Doe",
"id_number": "GHA123456789",
"email": "johndoe@example.com"
}
}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.mypayd.app/api/v3/payments"
method := "POST"
payload := strings.NewReader(`{
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "John Doe",
"account_number": "+254712434671",
"amount": 100,
"phone_number": "07712345671",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Event Ticket Purchase",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"customer_info": {
"country": "Ghana",
"address": "123 Independence Ave, Accra",
"id_type": "Passport",
"phone": "+23312345678`",
"dob": "1990-05-15",
"name": "John Doe",
"id_number": "GHA123456789",
"email": "johndoe@example.com"
}
}`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var axios = require('axios');
var data = JSON.stringify({
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "John Doe",
"account_number": "+254712434671",
"amount": 100,
"phone_number": "07712345671",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Event Ticket Purchase",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"customer_info": {
"country": "Ghana",
"address": "123 Independence Ave, Accra",
"id_type": "Passport",
"phone": "+23312345678",
"dob": "1990-05-15",
"name": "John Doe",
"id_number": "GHA123456789",
"email": "johndoe@example.com"
}
});
var config = {
method: 'post',
url: 'https://api.mypayd.app/api/v3/payments',
headers: { 'Content-Type': 'application/json' },
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "https://api.mypayd.app/api/v3/payments"
payload = {
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "John Doe",
"account_number": "+254712434671",
"amount": 100,
"phone_number": "07712345671",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Event Ticket Purchase",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"customer_info": {
"country": "Ghana",
"address": "123 Independence Ave, Accra",
"id_type": "Passport",
"phone": "+2331245678",
"dob": "1990-05-15",
"name": "John Doe",
"id_number": "GHA123456789",
"email": "johndoe@example.com"
}
}
response = requests.post(url, json=payload)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.mypayd.app/api/v3/payments",
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(array(
"username" => "paydconsultant",
"network_code" => "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name" => "John Doe",
"account_number" => "+254712434671",
"amount" => 100,
"phone_number" => "07712345671",
"channel_id" => "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration" => "Event Ticket Purchase",
"currency" => "KES",
"callback_url" => "https://payd-test.free.beeceptor.com",
"transaction_channel" => "mobile",
"customer_info": {
"country": "Ghana",
"address": "123 Independence Ave, Accra",
"id_type": "Passport",
"phone": "+233501234567",
"dob": "1990-05-15",
"name": "John Doe",
"id_number": "GHA123456789",
"email": "johndoe@example.com"
}
)),
CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Example of a successful response
{
"status": "SUCCESS",
"transaction_reference": "NIC201102101eR",
"success": true,
"message": "Processed successfully",
"trackingId": "",
"reference": "",
"result": null
}
Conclusion
The Global Payments API makes it simple to collect and disburse payments across 35+ countries with one seamless integration.