Client libraries for PHP, Java, Ruby, Python, and .NET
End-to-end testing in our free sandbox environment
Clean, modern RESTful API built from the ground up
Create a payment link with an API request. Use our messaging interface to request payment or use your own texting channel.
Attach a one-time invoice or set up automated periodic subscription payments with simple API requests.
Automatic event notifications through webhooks means no need to download and parse reports.
Code example for creating an invoice payment:
<?php
$url = '<base-url>/shortcode/';
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => array(
'x-api-key': 'your_api_key' ,
'Content-Type': 'application/json',
'Authorization': 'your access token'
),
'content' => http_build_query(
array({
'AMOUNT'=> 'string',
'PHONE'=> 'string',
'INVOICE'=> 'string'
})
),
'timeout' => 60
)
));
$resp = file_get_contents($url, FALSE, $context);
print_r($resp);
?>
import requests
import json
$url = '<base-url>/shortcode/';
data = {
"AMOUNT": "string",
"PHONE": "string",
"INVOICE": "string"
}
headers = {
'x-api-key': 'your_api_key' ,
'Content-Type': 'application/json',
'Authorization': 'your access token'
}
response = requests.post(url, data=json.dumps(data), headers=headers)
require 'httparty'
url = '<base-url>/shortcode/';
data = {
"AMOUNT": "string",
"PHONE": "string",
"INVOICE": "string"
}
response = HTTParty.post(url,
:body => data.to_json,
:headers => {x-api-key: 'your_api_key',
Content-Type:'application/json',
Authorization: 'your_access_token'})
puts response.body
String payload = {
"AMOUNT": "string",
"PHONE": "string",
"INVOICE": "string"
}
String requestUrl= "<base-url>/shortcode/"
try{
URL url = new URL(requestUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestProperty(
"x-api-key": "your_api_key" ,
"Content-Type": "application/json",
"Authorization": "your access token"
);
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
writer.write(payload);
writer.close();
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuffer jsonString = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
jsonString.append(line);
}
br.close();
connection.disconnect();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
System.Net.WebRequest req = System.Net.WebRequest.Create("<base-url>/shortcode/");
try{
req.Method = "POST";
req.Headers.Add('x-api-key','your_api_key','Authorization','your_access_token');
byte[] sentData = Encoding.UTF8.GetBytes('payload_data');
req.ContentLength = sentData.Length;
using (System.IO.Stream sendStream = req.GetRequestStream()){
sendStream.Write(sentData, 0, sentData.Length);
sendStream.Close();
}
System.Net.WebResponse res = req.GetResponse();
Want to learn more about getting started? Read our API reference docs
Building with our API is painless and designed to integrate various payment plus methods into your business quickly and easily.
Step by step reference guides provide you with quick access to cutting edge payment plus solutions.
Got questions? Shoot us an email for 24x7 response. We are developers just like you, and are always available to resolve your queries.