Bank Payment Requests
Introduction
The Bank Payments API enables you to send money directly from your payd wallet to a recipient's bank account.
Typical use cases include:
- Vendor payments
- Payroll disbursements
- B2B invoice settlements
- Financial services (e.g., loan payouts)
Making Payment Requests
To make a bank payment request, send an HTTP POST request to the following endpoint:
https://api.mypayd.app/api/v3/payments
Authorization
Users need to include basic authentication credentials in the request headers.
Authorization: Basic <base64-encoded-username:password>
Content-Type: application/json
X-Payd-Merchant-ID: <your_merchant_id>
Request Body
This payload allows you to securely make bank-payments using the Payd API. The request body must include the following structure:
{
"username": "paydconsultant",
"account_name": "bank",
"amount": 15000,
"phone_number": "+256712345678",
"channel_id": "5de46c23-6461-4950-871f-a971490772cf",
"narration": "Payment for goods",
"currency": "UGX",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "bank"
}
Below are code examples in different programming languages demonstrating how to make card payments using HTTP POST requests.
- Curl
- Go
- Nodejs
- Python
- PHP
curl --location 'https://api.mypayd.app/api/v3/payments' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "paydconsultant",
"account_name": "bank",
"amount": 15000,
"phone_number": "+256712345678",
"channel_id": "5de46c23-6461-4950-871f-a971490772cf",
"narration": "Payment for goods",
"currency": "UGX",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "bank"
}'
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",
"account_name": "bank",
"amount": 15000,
"phone_number": "+256712345678",
"channel_id": "5de46c23-6461-4950-871f-a971490772cf",
"narration": "Payment for goods",
"currency": "UGX",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "bank"
}`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
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))
}
const axios = require('axios');
const data = "{\\n\\\"username\\\": \\\"paydconsultant\\\",\\n\\\"account_name\\\": \\\"bank\\\",\\n\\\"amount\\\": 15000,\\n\\\"phone_number\\\": \\\"+256712345678\\\",\\n\\\"channel_id\\\": \\\"5de46c23-6461-4950-871f-a971490772cf\\\",\\n\\\"narration\\\": \\\"Payment for goods\\\",\\n\\\"currency\\\": \\\"UGX\\\",\\n\\\"callback_url\\\": \\\"https://payd-test.free.beeceptor.com\\\",\\n\\\"transaction_channel\\\": \\\"bank\\\"\\n}";
const config = {
method: 'post',
maxBodyLength: Infinity,
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 = "{\\n\\\"username\\\": \\\"paydconsultant\\\",\\n\\\"account_name\\\": \\\"bank\\\",\\n\\\"amount\\\": 15000,\\n\\\"phone_number\\\": \\\"+256712345678\\\",\\n\\\"channel_id\\\": \\\"5de46c23-6461-4950-871f-a971490772cf\\\",\\n\\\"narration\\\": \\\"Payment for goods\\\",\\n\\\"currency\\\": \\\"UGX\\\",\\n\\\"callback_url\\\": \\\"https://payd-test.free.beeceptor.com\\\",\\n\\\"transaction_channel\\\": \\\"bank\\\"\\n}"
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.mypayd.app/api/v3/payments');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader('Content-Type', 'application/json');
$request->setBody("{\n\"username\": \"paydconsultant\",\n\"account_name\": \"bank\",\n\"amount\": 15000,\n\"phone_number\": \"+256712345678\",\n\"channel_id\": \"5de46c23-6461-4950-871f-a971490772cf\",\n\"narration\": \"Payment for goods\",\n\"currency\": \"UGX\",\n\"callback_url\": \"https://payd-test.free.beeceptor.com\",\n\"transaction_channel\": \"bank\"\n}");
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
} else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase();
}
} catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Example of a successful response
{
"status": "success",
"message": "Payment initiated",
"transaction_id": "txn_0123456789abcdef"
}
Conclusion
Whether you're building a payroll system, automating vendor payments, or launching a fintech app, Payd's flexible API ensures quick integration and reliable bank transaction processing.