Bank Payouts Requests
Introduction
The Bank Payments API enables you to receive money directly to your payd wallet from a client's bank account.
Making Bank Payouts Requests
To make a bank payment request, send an HTTP POST request to the following endpoint:
https://api.mypayd.app/api/v3/withdrawal
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 collect bank-based payments using the Payd API. The request body must include the following structure:
{
"username": "paydconsultantconsultants",
"network_code": "344f1324-11fb-4875-bd74-fbb43cd2b32d",
"account_name": "bank",
"account_holder_name": "amazing maverick",
"account_number": "+23471245678",
"amount": 2500,
"phone_number": "+234712345678",
"channel_id": "fe8f4989-3bf6-41ca-9621-ffe2bc127569",
"narration": "Payment for goods",
"currency": "NGN",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "bank",
"channel": "bank",
"provider_name": "OPay",
"provider_code": "100004" // can be used as channel code (from bulk api)
}
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/withdrawal' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "paydconsultantconsultants",
"network_code": "344f1324-11fb-4875-bd74-fbb43cd2b32d",
"account_name": "bank",
"account_holder_name": "amazing maverick",
"account_number": "+23471245678",
"amount": 2500,
"phone_number": "+234712345678",
"channel_id": "fe8f4989-3bf6-41ca-9621-ffe2bc127569",
"narration": "Payment for goods",
"currency": "NGN",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "bank",
"channel": "bank",
"provider_name": "OPay",
"provider_code": "100004" // can be used as channel code (from bulk api)
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.mypayd.app/api/v3/withdrawal"
method := "POST"
payload := strings.NewReader(`{{
"username": "paydconsultantconsultants",
"network_code": "344f1324-11fb-4875-bd74-fbb43cd2b32d",
"account_name": "bank",
"account_holder_name": "amazing maverick",
"account_number": "+23471245678",
"amount": 2500,
"phone_number": "+234712345678",
"channel_id": "fe8f4989-3bf6-41ca-9621-ffe2bc127569",
"narration": "Payment for goods",
"currency": "NGN",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "bank",
"channel": "bank",
"provider_name": "OPay",
"provider_code": "100004" // can be used as channel code (from bulk api)
}
}`)
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');
var data = "{\\n\\\"username\\\": \\\"paydconsultantconsultants\\\",\\n\\\"network_code\\\": \\\"344f1324-11fb-4875-bd74-fbb43cd2b32d\\\",\\n\\\"account_name\\\": \\\"bank\\\",\\n\\\"account_holder_name\\\": \\\"amazing maverick\\\",\\n\\\"account_number\\\": \\\"+23471245678\\\",\\n\\\"amount\\\": 2500,\\n\\\"phone_number\\\": \\\"+234712345678\\\",\\n\\\"channel_id\\\": \\\"fe8f4989-3bf6-41ca-9621-ffe2bc127569\\\",\\n\\\"narration\\\": \\\"Payment for goods\\\",\\n\\\"currency\\\": \\\"NGN\\\",\\n\\\"callback_url\\\": \\\"https://payd-test.free.beeceptor.com\\\",\\n\\\"transaction_channel\\\": \\\"bank\\\",\\n\\\"channel\\\": \\\"bank\\\",\\n\\\"provider_name\\\": \\\"OPay\\\",\\n\\\"provider_code\\\": \\\"100004\\\"\\n}";
const config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.mypayd.app/api/v3/withdrawal',
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/withdrawal"
payload = "{\\n\\\"username\\\": \\\"paydconsultantconsultants\\\",\\n\\\"network_code\\\": \\\"344f1324-11fb-4875-bd74-fbb43cd2b32d\\\",\\n\\\"account_name\\\": \\\"bank\\\",\\n\\\"account_holder_name\\\": \\\"amazing maverick\\\",\\n\\\"account_number\\\": \\\"+23471245678\\\",\\n\\\"amount\\\": 2500,\\n\\\"phone_number\\\": \\\"+234712345678\\\",\\n\\\"channel_id\\\": \\\"fe8f4989-3bf6-41ca-9621-ffe2bc127569\\\",\\n\\\"narration\\\": \\\"Payment for goods\\\",\\n\\\"currency\\\": \\\"NGN\\\",\\n\\\"callback_url\\\": \\\"https://payd-test.free.beeceptor.com\\\",\\n\\\"transaction_channel\\\": \\\"bank\\\",\\n\\\"channel\\\": \\\"bank\\\",\\n\\\"provider_name\\\": \\\"OPay\\\",\\n\\\"provider_code\\\": \\\"100004\\\"\\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/withdrawal');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader('Content-Type', 'application/json');
$request->setBody("{\n\"username\": \"paydconsultantconsultants\",\n\"network_code\": \"344f1324-11fb-4875-bd74-fbb43cd2b32d\",\n\"account_name\": \"bank\",\n\"account_holder_name\": \"amazing maverick\",\n\"account_number\": \"+23471245678\",\n\"amount\": 2500,\n\"phone_number\": \"+234712345678\",\n\"channel_id\": \"fe8f4989-3bf6-41ca-9621-ffe2bc127569\",\n\"narration\": \"Payment for goods\",\n\"currency\": \"NGN\",\n\"callback_url\": \"https://payd-test.free.beeceptor.com\",\n\"transaction_channel\": \"bank\",\n\"channel\": \"bank\",\n\"provider_name\": \"OPay\",\n\"provider_code\": \"100004\"\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 made successfully",
"transaction_id": "txn_0123456789abcdef"
}