Send money to another CloudPay customer (P2P)
curl --request POST \
--url https://api.cloudpay.africa/cloudpay/v1/transfers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_msisdn": "0722000111",
"amount": 100000,
"pin": "4821",
"idempotency_key": "3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42",
"narrative": "Rent share"
}
'import requests
url = "https://api.cloudpay.africa/cloudpay/v1/transfers"
payload = {
"to_msisdn": "0722000111",
"amount": 100000,
"pin": "4821",
"idempotency_key": "3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42",
"narrative": "Rent share"
}
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({
to_msisdn: '0722000111',
amount: 100000,
pin: '4821',
idempotency_key: '3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42',
narrative: 'Rent share'
})
};
fetch('https://api.cloudpay.africa/cloudpay/v1/transfers', 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.cloudpay.africa/cloudpay/v1/transfers",
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([
'to_msisdn' => '0722000111',
'amount' => 100000,
'pin' => '4821',
'idempotency_key' => '3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42',
'narrative' => 'Rent share'
]),
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.cloudpay.africa/cloudpay/v1/transfers"
payload := strings.NewReader("{\n \"to_msisdn\": \"0722000111\",\n \"amount\": 100000,\n \"pin\": \"4821\",\n \"idempotency_key\": \"3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42\",\n \"narrative\": \"Rent share\"\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.cloudpay.africa/cloudpay/v1/transfers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_msisdn\": \"0722000111\",\n \"amount\": 100000,\n \"pin\": \"4821\",\n \"idempotency_key\": \"3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42\",\n \"narrative\": \"Rent share\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudpay.africa/cloudpay/v1/transfers")
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 \"to_msisdn\": \"0722000111\",\n \"amount\": 100000,\n \"pin\": \"4821\",\n \"idempotency_key\": \"3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42\",\n \"narrative\": \"Rent share\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"ok": true,
"code": 123,
"desc": "<string>"
},
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "posted",
"amount": 100000,
"fee": 123,
"currency": "KES",
"to": {
"party_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"msisdn": "254712345678",
"display_name": "<string>"
},
"narrative": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"replayed": true
}
}{
"status": {
"ok": true,
"code": 123,
"desc": "<string>"
},
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "posted",
"amount": 100000,
"fee": 123,
"currency": "KES",
"to": {
"party_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"msisdn": "254712345678",
"display_name": "<string>"
},
"narrative": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"replayed": true
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}Payments
Send money to another CloudPay customer (P2P)
Order of checks: PIN -> recipient -> tier limits (per transaction and daily) -> risk ->
ledger (funds, account status). The fee from the tenant’s fee bands is charged on top
of amount. Returns 201 for a new transfer and 200 with replayed: true for a retry.
POST
/
v1
/
transfers
Send money to another CloudPay customer (P2P)
curl --request POST \
--url https://api.cloudpay.africa/cloudpay/v1/transfers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_msisdn": "0722000111",
"amount": 100000,
"pin": "4821",
"idempotency_key": "3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42",
"narrative": "Rent share"
}
'import requests
url = "https://api.cloudpay.africa/cloudpay/v1/transfers"
payload = {
"to_msisdn": "0722000111",
"amount": 100000,
"pin": "4821",
"idempotency_key": "3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42",
"narrative": "Rent share"
}
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({
to_msisdn: '0722000111',
amount: 100000,
pin: '4821',
idempotency_key: '3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42',
narrative: 'Rent share'
})
};
fetch('https://api.cloudpay.africa/cloudpay/v1/transfers', 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.cloudpay.africa/cloudpay/v1/transfers",
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([
'to_msisdn' => '0722000111',
'amount' => 100000,
'pin' => '4821',
'idempotency_key' => '3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42',
'narrative' => 'Rent share'
]),
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.cloudpay.africa/cloudpay/v1/transfers"
payload := strings.NewReader("{\n \"to_msisdn\": \"0722000111\",\n \"amount\": 100000,\n \"pin\": \"4821\",\n \"idempotency_key\": \"3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42\",\n \"narrative\": \"Rent share\"\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.cloudpay.africa/cloudpay/v1/transfers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_msisdn\": \"0722000111\",\n \"amount\": 100000,\n \"pin\": \"4821\",\n \"idempotency_key\": \"3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42\",\n \"narrative\": \"Rent share\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudpay.africa/cloudpay/v1/transfers")
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 \"to_msisdn\": \"0722000111\",\n \"amount\": 100000,\n \"pin\": \"4821\",\n \"idempotency_key\": \"3f1c9a7e-2b8d-4c55-9a51-1e6c3b0d7f42\",\n \"narrative\": \"Rent share\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"ok": true,
"code": 123,
"desc": "<string>"
},
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "posted",
"amount": 100000,
"fee": 123,
"currency": "KES",
"to": {
"party_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"msisdn": "254712345678",
"display_name": "<string>"
},
"narrative": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"replayed": true
}
}{
"status": {
"ok": true,
"code": 123,
"desc": "<string>"
},
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "posted",
"amount": 100000,
"fee": 123,
"currency": "KES",
"to": {
"party_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"msisdn": "254712345678",
"display_name": "<string>"
},
"narrative": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"replayed": true
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}{
"status": {
"ok": false,
"code": 422,
"desc": "Unprocessable Entity"
},
"errors": {
"code": "insufficient_funds",
"message": "insufficient funds"
}
}Authorizations
Body
application/json