Open a business (you become its owner)
curl --request POST \
--url https://api.cloudpay.africa/cloudpay/v1/merchants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"till_name": "<string>",
"branch": "<string>",
"contact_msisdn": "<string>"
}
'import requests
url = "https://api.cloudpay.africa/cloudpay/v1/merchants"
payload = {
"name": "<string>",
"till_name": "<string>",
"branch": "<string>",
"contact_msisdn": "<string>"
}
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({
name: '<string>',
till_name: '<string>',
branch: '<string>',
contact_msisdn: '<string>'
})
};
fetch('https://api.cloudpay.africa/cloudpay/v1/merchants', 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/merchants",
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([
'name' => '<string>',
'till_name' => '<string>',
'branch' => '<string>',
'contact_msisdn' => '<string>'
]),
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/merchants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"till_name\": \"<string>\",\n \"branch\": \"<string>\",\n \"contact_msisdn\": \"<string>\"\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/merchants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"till_name\": \"<string>\",\n \"branch\": \"<string>\",\n \"contact_msisdn\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudpay.africa/cloudpay/v1/merchants")
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 \"name\": \"<string>\",\n \"till_name\": \"<string>\",\n \"branch\": \"<string>\",\n \"contact_msisdn\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"ok": true,
"code": 123,
"desc": "<string>"
},
"data": {
"merchant": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"party_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"main_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"twin_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"live_approved_at": "2023-11-07T05:31:56Z",
"production_approved_at": "2023-11-07T05:31:56Z",
"access_approved_at": "2023-11-07T05:31:56Z"
},
"till": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>",
"branch": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"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"
}
}Merchant API
Open a business (you become its owner)
Creates the business party, its main account, the owner membership and a first till with a QR code.
Unless the tenant turned signup_approval_required off, the business starts with access_approved_at: null: until CloudPay approves it, only GET /v1/merchants/{id} and the /kyb routes answer; everything else is 403 merchant_pending.
POST
/
v1
/
merchants
Open a business (you become its owner)
curl --request POST \
--url https://api.cloudpay.africa/cloudpay/v1/merchants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"till_name": "<string>",
"branch": "<string>",
"contact_msisdn": "<string>"
}
'import requests
url = "https://api.cloudpay.africa/cloudpay/v1/merchants"
payload = {
"name": "<string>",
"till_name": "<string>",
"branch": "<string>",
"contact_msisdn": "<string>"
}
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({
name: '<string>',
till_name: '<string>',
branch: '<string>',
contact_msisdn: '<string>'
})
};
fetch('https://api.cloudpay.africa/cloudpay/v1/merchants', 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/merchants",
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([
'name' => '<string>',
'till_name' => '<string>',
'branch' => '<string>',
'contact_msisdn' => '<string>'
]),
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/merchants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"till_name\": \"<string>\",\n \"branch\": \"<string>\",\n \"contact_msisdn\": \"<string>\"\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/merchants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"till_name\": \"<string>\",\n \"branch\": \"<string>\",\n \"contact_msisdn\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudpay.africa/cloudpay/v1/merchants")
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 \"name\": \"<string>\",\n \"till_name\": \"<string>\",\n \"branch\": \"<string>\",\n \"contact_msisdn\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"ok": true,
"code": 123,
"desc": "<string>"
},
"data": {
"merchant": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"party_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"main_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"twin_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"live_approved_at": "2023-11-07T05:31:56Z",
"production_approved_at": "2023-11-07T05:31:56Z",
"access_approved_at": "2023-11-07T05:31:56Z"
},
"till": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>",
"branch": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"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"
}
}