NAV Navbar
shell java javascript php python

PayGate.Africa API v2.0.0

The Payment Gateway of Africa!

Ever wonder how to accept african payments in your projects? Paygate.africa is the tool you've been looking for. In no time the Paygate API documentation will allow you to expose your business to african customers. You'll be able to bill, collect payments and perform transfers all over Africa and beyond.

Paygate.africa is an all in one payment REST API that aims to gather major african payment providers solutions along with international bank cards, systems like Paypal and cryptocurrencies.

Different integration options are available depending on your profile. Even though this guide is dedicated to developers, it gives a good detailled overview of functionalities available on the platform. Most commonly used programming languages samples are available so you know exactly how to proceed and what to expect.

Why choosing PayGate ?

Paygate.Africa takes off the pressure of having to contract with one or a selected list of solutions providers to collect payments and believe us, it can be very cumbersome and time consuming. We allow you to focus on the development of your business and to rapidly expose your products to the targetted populations.

We also provide you with a lot of useful services that make us very different at every step. And since we're API driven, almost all PayGate functionnalities are available in the documentation making it possible for you to design personalized dashboards for various usages.

If you are a financial institution looking forward to propose innovative services to your customers, we got your back. Contact us to know how we can collaborate and help you achieve your goals.

As of today, here is the list of onboarded payment options

The Big Picture

PayGate API integration journey can be summed into the following steps

Paygate.africa is a product of the patented Moneytic Platform © solution.

Where to start ?

You need an account! Use the following URL as the entry point that will later be defined as "BASE-URL".

BASE-URL: https://api.paygate.africa

We exposed almost all actions related to the management of your profile and applications here from the creation of your account to the download of financial reports making it possible for you to design different types of dashboards for example. Having this in mind, as a developer, you can fully control the way you desire to interact with the platform and find your own innovative ways to create new experiences from a solid basis.

Quickstart

This section takes you through the essential requests you need to quickly implement the PayGate solution and start collecting payments.

Create Account

POST /accounts

curl -b cookie.txt --location --request POST 'https://api.paygate.africa/accounts' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstname": "Firstname",
    "lastname": "Lastname",
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!",
    "cgu": 1
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/accounts")
  .header("Content-Type", "application/json")
  .body("{
    \"firstname\": \"App\",
    \"lastname\": \"User\",
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\",
    \"cgu\": 1
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/accounts')
  .headers({
    'Content-Type': 'application/json'
  })
  .send(JSON.stringify({
      "firstname":"App",
      "lastname":"User",
      "email":"your@email",
      "password":"YourStrongPa§§w0rd!",
      "cgu":1
    })
  )
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/accounts');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "firstname": "Account",
    "lastname": "User",
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!",
    "cgu": 1
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/accounts"
payload = "{
    \"firstname\": \"App\",
    \"lastname\": \"User\",
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\",
    \"cgu\": 1
    }"
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "account_id": "YOUR-ACCOUNT_ID"
}

POST BASE-URL/accounts

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
firstname string true Account owner firstname
lastname string true Account owner family name
displayname string false Account owner nickname
picture url false Account owner profile image url
language string false Account owner language. Defaults to FR. Can be one of FR, EN, ES, IT, DE
email email true Account owner email
password string true Should be between 8 to 32 characters, alphanumeric, contain uppercase and at least one symbol ie: "pa$$W0rd!"
cgu boolean true Set to 1 if you agree with terms of use

Response Object

Parameter Type Description
account_id string The unique account owner id

User Login

POST /auth/login

curl -c cookie.txt --location --request POST 'https://api.paygate.africa/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!"
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/auth/login")
  .header("Content-Type", "application/json")
  .body("{
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\"
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/auth/login')
  .headers({
    'Content-Type': 'application/json'
  })
  .send(JSON.stringify({
      "email":"your@email",
      "password":"YourStrongPa§§w0rd!"
    })
  )
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/auth/login');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/auth/login"
payload = "{
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\"
    }"
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "firstname": "Account",
    "lastname": "User",
    "displayname": "Account",
    "account_id": "ACCOUNT-ID",
    "picture": "",
    "email": "your@email",
    "createdAt": "2012-04-11T08:13:38.000Z"
}

POST BASE-URL/login

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
email email true Account owner email
password string true Account owner password

Response Object

Parameter Type Description
firstname string Account owner firstname
lastname string Account owner lastname
displayname string Account owner nickname
account_id string The unique account owner id
picture url Account owner profile picture url
email email Account owner email
createdAt date Account creation date

Create New Application

POST /applications

curl --location --request POST 'https://api.paygate.africa/applications' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "APP_NAME",
    "description": "I use this application to run my sandbox store",
    "logo": "https://sandboxstore.paygate.africa\logo.png",
    "website": "https://sandboxstore.paygate.africa"
}
'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/applications")
  .header("Content-Type", "application/json")
  .body("{
    \"name\": \"APP_NAME\",
    \"description\": \"I use this application to run my sandbox store\",
    \"logo\": \"https://sandboxstore.paygate.africa/logo.png\",
    \"website\": \"https://sandboxstore.paygate.africa\"
  }
  ")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/applications')
  .headers({
    'Content-Type': 'application/json'
  })
  .send(JSON.stringify({
      "name":"APP_NAME",
      "description":"I use this application to run my sandbox store",
      "logo": "https://sandboxstore.paygate.africa/logo.png",
      "website":"https://sandboxstore.paygate.africa"
      }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "name": "APP_NAME",
    "description": "I use this application to run my sandbox store",
    "logo": "https://sandboxstore.paygate.africa/logo.png",
    "website": "https://sandboxstore.paygate.africa"
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/applications"

payload = "{
    \"name\": \"APP_NAME\",
    \"description\": \"I use this application to run my sandbox store\",
    \"logo\": \"https://sandboxstore.paygate.africa/logo.png\",
    \"website\": \"https://sandboxstore.paygate.africa\"
    }"
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "app_id": "YOUR_APP_ID",
    "merchant_code": "YOUR_MERCHANT_CODE",
    "name": "APP_NAME",
    "description": "I use this application to run my sandbox store",
    "trx_commission_amount": 0,
    "website": "https://sandboxstore.paygate.africa",
    "logo": "",
    "createdAt": "2020-06-23T06:08:41.000Z",
    "keys": [
        {
            "client_id": "APP_CLIENT_ID",
            "client_secret": "APP_CLIENT_SECRET",
            "refresh_token": "APP_REFRESH_TOKEN",
            "createdAt": "2012-06-23T06:08:42.000Z"
        }
    ]
}

POST BASE-URL/applications

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
name string true Application name
description string false Activity description
logo string false Application logo link
website string false Application website link

Response Object

Parameter Type Description
app_id string Your application id
merchant_code string Your merchant code
name string The provided name of the application
description string The provided description of your activity
trx_commission_amount number Fixed fees applied on successful transactions
website string Your website link
logo string Your application logo link
createdAt date The application creation date
keys array The set of keys needed for the application to authenticate

Get Application Token

POST /auth/connect/application

curl --location --request POST 'https://api.paygate.africa/auth/connect/application' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic token' \
--header 'app_id: APP-ID' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/auth/connect/application")
  .header("Content-Type", "application/json")
  .header("Authorization", "Basic token")
  .header("app_id", "APP-ID")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/auth/connect/application')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Basic token',
    'app_id': 'APP-ID'
  })
  .send(JSON.stringify({}))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/auth/connect/application');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Basic token',
  'app_id' => 'APP-ID'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/auth/connect/application"

payload = ""
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic token',
  'app_id': 'APP-ID'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "connect_token": "Bearer token",
    "refresh_token": ":refresh_token"
}

POST BASE-URL/auth/connect/application

Request Headers

Parameter Required Value
Content-Type false application/json
Authorization true Basic base64 ( client_id : client_secret ) cf here
app_id true application unique identifier

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
connect_token string The bearer token that will be used to authenticate requests
refresh_token string The refresh token that will be used to wake up connections

Register Transaction

POST /transactions

curl --location --request POST 'https://api.paygate.africa/transactions' \
--header 'Content-Type: application/json' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "amount": "100.00",
    "currency": "XOF",
    "payment_options": "preorder",
    "preorder_end_date": "2012-06-28T15:05:00.000Z",
    "order_ref": "3701",
    "items": 2,
    "cart":[{
        "product_name": "product 1",
        "product_code": "ADBFRT345",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    },{
        "product_name": "product 2",
        "product_code": "ADBZSER35",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    }]
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/transactions")
  .header("Content-Type", "application/json")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .body("{
      \"amount\": \"100.00\",
      \"currency\": \"XOF\",
      \"payment_options\": \"preorder\",
      \"preorder_end_date\": \"2012-06-28T15:05:00.000Z\",
      \"order_ref\": \"3701\",
      \"items\": 2,
      \"cart\":[{
            \"product_name\": \"product 1\",
            \"product_code\": \"ADBFRT345\",
            \"quantity\": 1,
            \"price\": \"50.00\",
            \"total\": \"50.00\",
            \"image\": \"\",
            \"description\": \"\",
            \"note_1\": \"\",
            \"note_2\": \"\",
            \"note_3\": \"\",
            \"note_4\": \"\",
            \"note_5\": \"\"
        },{
            \"product_name\": \"product 2\",
            \"product_code\": \"ADBZSER35\",
            \"quantity\": 1,
            \"price\": \"50.00\",
            \"total\": \"50.00\",
            \"image\": \"\",
            \"description\": \"\",
            \"note_1\": \"\",
            \"note_2\": \"\",
            \"note_3\": \"\",
            \"note_4\": \"\",
            \"note_5\": \"\"
        }]
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/transactions')
  .headers({
    'Content-Type': 'application/json',
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .send(JSON.stringify({
      "amount":"100.00",
      "currency":"XOF",
      "payment_options":"preorder",
      "preorder_end_date":"2012-06-28T15:05:00.000Z",
      "order_ref":"3701",
      "items":2,
      "cart":[{
          "product_name":"product 1",
          "product_code":"ADBFRT345",
          "quantity":1,
          "price":"50.00",
          "total":"50.00",
          "image":"",
          "description":"",
          "note_1":"",
          "note_2":"",
          "note_3":"",
          "note_4":"",
          "note_5":""
        },{
          "product_name":"product 2",
          "product_code":"ADBZSER35",
          "quantity":1,
          "price":"50.00",
          "total":"50.00",
          "image":"",
          "description":"",
          "note_1":"",
          "note_2":"",
          "note_3":"",
          "note_4":"",
          "note_5":""
        }]
    }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "amount": "100.00",
    "currency": "XOF",
    "payment_options": "preorder",
    "preorder_end_date": "2012-06-28T15:05:00.000Z",
    "order_ref": "3701",
    "items": 2,
    "cart":[{
        "product_name": "product 1",
        "product_code": "ADBFRT345",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    },{
        "product_name": "product 2",
        "product_code": "ADBZSER35",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    }]
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/transactions"

payload = "{
    \"amount\": \"100.00\",
    \"currency\": \"XOF\",
    \"payment_options\": \"preorder\",
    \"preorder_end_date\": \"2012-06-28T15:05:00.000Z\",
    \"order_ref\": \"3701\",
    \"items\": 2,
    \"cart\":[{
        \"product_name\": \"product 1\",
        \"product_code\": \"ADBFRT345\",
        \"quantity\": 1,
        \"price\": \"50.00\",
        \"total\": \"50.00\",
        \"image\": \"\",
        \"description\": \"\",
        \"note_1\": \"\",
        \"note_2\": \"\",
        \"note_3\": \"\",
        \"note_4\": \"\",
        \"note_5\": \"\"
    },{
        \"product_name\": \"product 2\",
        \"product_code\": \"ADBZSER35\",
        \"quantity\": 1,
        \"price\": \"50.00\",
        \"total\": \"50.00\",
        \"image\": \"\",
        \"description\": \"\",
        \"note_1\": \"\",
        \"note_2\": \"\",
        \"note_3\": \"\",
        \"note_4\": \"\",
        \"note_5\": \"\"
    }]
}"
headers = {
  'Content-Type': 'application/json',
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "transaction_id": "TRANSACTION-ID",
    "amount": 100,
    "currency": "XOF",
    "order_ref": "3701",
    "payment_options": "preorder",
    "expiresAt": "2012-06-28T15:05:00.000Z",
    "preorder_end_date": "2012-06-28T15:05:00.000Z",
    "createdAt": "2012-06-24T15:05:48.000Z",
    "capture_url": "https://api.paygate.africa/transactions/TRANSACTION-ID/payment/capture"
}

POST BASE-URL/transactions

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description
amount number true Amount to bill
currency string true Currency iso code defaults to XOF
payment_options string false Set the desired payment option between "instant" or "preorder"
preorder_end_date date false Only required if payment option value is set to or contains "preorder" value
order_ref string false Allow merchants to add their own reference
items number false Number of items contained within the cart. Should be declared if cart is non empty and match the exact number of items in cart
cart array false Contains items details that will be displayed to customer at checkout

Transactions Payment Options

Option Name Description Time Range
instant Merchant requests customer to be debited at purchase 0 - 15 minutes
preorder Customer is debited for the order and merchant will be credited at delivery 3 - 30 days

Response Object

Parameter Type Description
transaction_id string The unique transaction id generated by the system
amount number Amount to bill
currency string Currency iso code defaults to XOF
order_ref string Allow merchants to add their own reference
payment_options string The desired payment option set
preorder_end_date date Preorder end date. Payment should be done prior this date
expiresAt date Payment expiration date
createdAt date Transaction creation date
capture_url url The link to redirect the customer for payment

Get Transaction Status

GET /transactions/:transaction_id/payment

curl --location --request GET 'https://api.paygate.africa/transactions/TRANSACTION-ID/payment' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/transactions/TRANSACTION-ID/payment")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/transactions/TRANSACTION-ID/payment')
  .headers({
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions/TRANSACTION-ID/payment');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/transactions/TRANSACTION-ID/payment"

payload = {}
headers = {
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "transaction_id": "TRANSACTION-ID",
    "amount": 100,
    "currency": "XOF",
    "order_ref": "3715",
    "payment_options": "preorder",
    "expiresAt": "2020-06-26T02:54:47.000Z",
    "preorder_end_date": "2020-06-30T14:40:00.000Z",
    "createdAt": "2020-06-26T14:40:22.000Z",
    "payment": {
        "fees": 0,
        "commission": 0,
        "createdAt": "2020-06-26T15:05:21.000Z",
        "channel": "PAYMENT NAME",
        "status": "PENDING"
    }
}

GET BASE-URL/transactions/:transaction_id/payment

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
transaction_id string The unique transaction id generated by the system
amount number Amount to bill
currency string Currency iso code defaults to XOF
order_ref string Allow merchants to add their own reference
payment_options string The desired payment option set
preorder_end_date date Preorder end date. Payment should be done prior this date
expiresAt date Payment expiration date
createdAt date Transaction creation date
payment array Contains the payment details

Accounts Management

Register

POST /accounts

curl -b cookie.txt --location --request POST 'https://api.paygate.africa/accounts' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstname": "Firstname",
    "lastname": "Lastname",
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!",
    "cgu": 1
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/accounts")
  .header("Content-Type", "application/json")
  .body("{
    \"firstname\": \"App\",
    \"lastname\": \"User\",
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\",
    \"cgu\": 1
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/accounts')
  .headers({
    'Content-Type': 'application/json'
  })
  .send(JSON.stringify({
      "firstname":"App",
      "lastname":"User",
      "email":"your@email",
      "password":"YourStrongPa§§w0rd!",
      "cgu":1
    })
  )
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/accounts');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "firstname": "Account",
    "lastname": "User",
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!",
    "cgu": 1
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/accounts"
payload = "{
    \"firstname\": \"App\",
    \"lastname\": \"User\",
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\",
    \"cgu\": 1
    }"
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "account_id": "YOUR-ACCOUNT_ID"
}

POST BASE-URL/accounts

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
firstname string true Account owner firstname
lastname string true Account owner family name
displayname string false Account owner nickname
picture url false Account owner profile image url
language string false Account owner language. Defaults to FR. Can be one of FR, EN, ES, IT, DE
email email true Account owner email
password string true Should be between 8 to 32 characters, alphanumeric, contain uppercase and at least one symbol ie: "pa$$W0rd!"
cgu boolean true Set to 1 if you agree with terms of use

Response Object

Parameter Type Description
account_id string The unique account owner id

Login

POST /auth/login

curl -c cookie.txt --location --request POST 'https://api.paygate.africa/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!"
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/auth/login")
  .header("Content-Type", "application/json")
  .body("{
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\"
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/auth/login')
  .headers({
    'Content-Type': 'application/json'
  })
  .send(JSON.stringify({
      "email":"your@email",
      "password":"YourStrongPa§§w0rd!"
    })
  )
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/auth/login');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "email": "your@email",
    "password": "YourStrongPa§§w0rd!"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/auth/login"
payload = "{
    \"email\": \"your@email\",
    \"password\": \"YourStrongPa§§w0rd!\"
    }"
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "firstname": "Account",
    "lastname": "User",
    "displayname": "Account",
    "account_id": "ACCOUNT-ID",
    "picture": "",
    "email": "your@email",
    "createdAt": "2012-04-11T08:13:38.000Z"
}

POST BASE-URL/login

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
email email true Account owner email
password string true Account owner password

Response Object

Parameter Type Description
firstname string Account owner firstname
lastname string Account owner lastname
displayname string Account owner nickname
account_id string The unique account owner id
picture url Account owner profile picture url
email email Account owner email
createdAt date Account creation date

Profile Update

PUT /accounts

curl -b cookie.txt --location --request PUT 'https://api.paygate.africa/accounts' \
--header 'Content-Type: application/json' \
--data-raw '{
    "displayname": "ACCOUNT USER NAME"
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.put("https://api.paygate.africa/accounts")
  .header("Content-Type", "application/json")
  .body("{
    \"displayname\": \"ACCOUNT USER NAME\"
}")
  .asString();
var unirest = require('unirest');
var req = unirest('PUT', 'https://api.paygate.africa/accounts')
  .headers({
    'Content-Type': 'application/json'
  })
  .send("{
    \"displayname\": \"ACCOUNT USER NAME\"
  }")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/accounts');
$request->setRequestMethod('PUT');
$body = new http\Message\Body;
$body->append('{
    "displayname": "ACCOUNT USER NAME"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/accounts"
payload = "{
    \"displayname\": \"ACCOUNT USER NAME\"
}"
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "firstname": "Account",
    "lastname": "User",
    "displayname": "ACCOUNT USER NAME",
    "provider": "local",
    "account_id": "ACCOUNT-ID",
    "picture": "",
    "email": "your@email",
    "createdAt": "2012-04-12T07:36:18.000Z"
}

PUT BASE-URL/accounts

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
firstname string true Account owner firstname
lastname string true Account owner family name
displayname string false Account owner nickname
picture url false Account owner profile image url
language string false Account owner language. Defaults to FR. Can be one of FR, EN, ES, IT, DE
email email true Account owner email

Response Object

Parameter Type Description
firstname string Account owner firstname
lastname string Account owner lastname
displayname string Account owner nickname
account_id string The unique account owner id
picture url Account owner profile picture url
email email Account owner email
createdAt date Account creation date

Profile Read

GET /accounts/me

curl -b cookie.txt --location --request GET 'https://api.paygate.africa/accounts/me' \
--header 'Content-Type: application/json' 
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/accounts/me")
  .header("Content-Type", "application/json")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/accounts/me')
  .headers({
    'Content-Type': 'application/json'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/accounts/me');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/accounts/me"
payload = {}
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "firstname": "Account",
    "lastname": "User",
    "displayname": "ACCOUNT USER NAME",
    "provider": "local",
    "account_id": "ACCOUNT-ID",
    "picture": "",
    "email": "your@email",
    "createdAt": "2012-04-12T07:36:18.000Z"
}

GET BASE-URL/accounts/me

Request Headers

Parameter Required Value
Content-Type false application/json

Response Object

Parameter Type Description
firstname string Account owner firstname
lastname string Account owner lastname
displayname string Account owner nickname
account_id string The unique account owner id
email email Account owner email
createdAt date Account creation date

Password Reset

PUT /accounts/password

curl -b cookie.txt --location --request PUT 'https://api.paygate.africa/accounts/password' \
--header 'Content-Type: application/json' \
--data-raw '{
    "password": "YourStrongPa§§w0rd!",
    "new_password": "newStrongPa§§w0rd!",
    "confirm_password": "newStrongPa§§w0rd!"
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.put("https://api.paygate.africa/accounts/password")
  .header("Content-Type", "application/json")
  .header("Cookie", "session_id=SESSION-ID")
  .body("{
    \"password\": \"YourStrongPa§§w0rd!\",
    \"new_password\": \"newStrongPa§§w0rd!\",
    \"confirm_password\": \"newStrongPa§§w0rd!\"
}")
  .asString();
var unirest = require('unirest');
var req = unirest('PUT', 'https://api.paygate.africa/accounts/password')
  .headers({
    'Content-Type': 'application/json',
    'Cookie': 'session_id=SESSION-ID'
  })
  .send(JSON.stringify({
      "password":"YourStrongPa§§w0rd!",
      "new_password":"newStrongPa§§w0rd!",
      "confirm_password":"newStrongPa§§w0rd!"
    })
  )
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/accounts/password');
$request->setRequestMethod('PUT');
$body = new http\Message\Body;
$body->append('{
    "password": "YourStrongPa§§w0rd!",
    "new_password": "newStrongPa§§w0rd!",
    "confirm_password": "newStrongPa§§w0rd!"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Cookie' => 'session_id=SESSION-ID'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/accounts/password"
payload = "{
    \"password\": \"YourStrongPa§§w0rd!\",
    \"new_password\": \"newStrongPa§§w0rd!\",
    \"confirm_password\": \"newStrongPa§§w0rd!\"
}"
headers = {
  'Content-Type': 'application/json',
  'Cookie': 'session_id=SESSION-ID'
}
response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{}

PUT BASE-URL/accounts/password

Request Headers

Parameter Required Value
Content-Type false application/json
Cookie true session_id got from the login response

Request Body

Parameter Type Required Description
password string true Account owner current password
new_password string true Account owner new password. Should be between 8 to 32 characters, alphanumeric, contain uppercase and at least one symbol ie: "pa$$W0rd!"
confirm_password string false Account owner new password confirmation

Response Object

Parameter Type Description

Logout

GET /auth/logout

curl -b cookie.txt --location --request GET 'https://api.paygate.africa/auth/logout' \
--header 'Content-Type: application/json' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/auth/logout")
  .header("Content-Type", "application/json")
  .header("Cookie", "session_id=SESSION-ID")
  .body("")
  .asString();
var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/auth/logout')
  .headers({
    'Content-Type': 'application/json',
    'Cookie': 'SESSION-ID'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/auth/logout');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Cookie' => 'session_id=SESSION-ID'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/auth/logout"
payload  = {}
headers = {
  'Content-Type': 'application/json',
  'Cookie': 'session_id=SESSION-ID'
}
response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{}

GET BASE-URL/auth/logout

Request Headers

Parameter Required Value
Content-Type false application/json
Cookie true session_id got from the login response

Response Object

Parameter Type Description

Delete

DELETE /accounts

curl -b cookie.txt --location --request DELETE 'https://api.paygate.africa/accounts' \
--header 'Content-Type: application/json' 
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.delete("https://api.paygate.africa/accounts")
  .header("Content-Type", "application/json")
  .asString();

var unirest = require('unirest');
var req = unirest('DELETE', 'https://api.paygate.africa/accounts')
  .headers({
    'Content-Type': 'application/json'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/accounts');
$request->setRequestMethod('DELETE');
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/accounts"
payload = {}
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("DELETE", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{}

DELETE BASE-URL/accounts

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description

Applications Management

Application management consists in a set of CRUD (Create, Read, Update an Delete) operations that can be performed by a user who has the appropriate rights. It also involves managing the users we call collaborators you plan to work with at an application level.

An application can be seen like a store or a particular financial business unit. Creation of an application is the first step for a merchant. From there, you will access a set of resources that will allow you to collect payments.

There is no restriction in the number of applications you can create. Thus you can have one dedicated application for every business unit you run. This will allow you to access a set of reports per application making it easy to monitor each application performances.

Create Application

POST /applications

curl --location --request POST 'https://api.paygate.africa/applications' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "APP_NAME",
    "description": "I use this application to run my sandbox store",
    "logo": "https://sandboxstore.paygate.africa\logo.png",
    "website": "https://sandboxstore.paygate.africa"
}
'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/applications")
  .header("Content-Type", "application/json")
  .body("{
    \"name\": \"APP_NAME\",
    \"description\": \"I use this application to run my sandbox store\",
    \"logo\": \"https://sandboxstore.paygate.africa/logo.png\",
    \"website\": \"https://sandboxstore.paygate.africa\"
  }
  ")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/applications')
  .headers({
    'Content-Type': 'application/json'
  })
  .send(JSON.stringify({
      "name":"APP_NAME",
      "description":"I use this application to run my sandbox store",
      "logo": "https://sandboxstore.paygate.africa/logo.png",
      "website":"https://sandboxstore.paygate.africa"
      }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "name": "APP_NAME",
    "description": "I use this application to run my sandbox store",
    "logo": "https://sandboxstore.paygate.africa/logo.png",
    "website": "https://sandboxstore.paygate.africa"
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/applications"

payload = "{
    \"name\": \"APP_NAME\",
    \"description\": \"I use this application to run my sandbox store\",
    \"logo\": \"https://sandboxstore.paygate.africa/logo.png\",
    \"website\": \"https://sandboxstore.paygate.africa\"
    }"
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "app_id": "YOUR_APP_ID",
    "merchant_code": "YOUR_MERCHANT_CODE",
    "name": "APP_NAME",
    "description": "I use this application to run my sandbox store",
    "trx_commission_amount": 0,
    "website": "https://sandboxstore.paygate.africa",
    "logo": "",
    "createdAt": "2020-06-23T06:08:41.000Z",
    "keys": [
        {
            "client_id": "APP_CLIENT_ID",
            "client_secret": "APP_CLIENT_SECRET",
            "refresh_token": "APP_REFRESH_TOKEN",
            "createdAt": "2012-06-23T06:08:42.000Z"
        }
    ]
}

POST BASE-URL/applications

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
name string true Application name
description string false Activity description
logo string false Application logo link
website string false Application website link

Response Object

Parameter Type Description
app_id string Your application id
merchant_code string Your merchant code
name string The provided name of the application
description string The provided description of your activity
trx_commission_amount number Fixed fees applied on successful transactions
website string Your website link
logo string Your application logo link
createdAt date The application creation date
keys array The set of keys needed for the application to authenticate

List Applications

GET /applications/list

curl --location --request GET 'https://api.paygate.africa/applications/list' \
--header 'Content-Type: application/json' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/applications/list")
  .header("Content-Type", "application/json")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/applications/list')
  .headers({
    'Content-Type': 'application/json'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/list');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/list"

payload  = {}
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

[
    {
        "app_id": ":app_id",
        "merchant_code": "1000000",
        "name": "AppTest 1",
        "description": "",
        "trx_commission_amount": 0,
        "website": "",
        "logo": "",
        "createdAt": "2012-06-23T06:44:53.000Z"
    },
    ...
    {
        "app_id": "$2a$10...xFHSY3.",
        "merchant_code": "3000000",
        "name": "AppTest 3",
        "description": "Ceci est une application de test",
        "trx_commission_amount": 0,
        "website": "http://",
        "logo": "",
        "createdAt": "2017-06-14T04:25:29.000Z"
    }
]

GET BASE-URL/applications/list

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
applications array An array of objects containing account applications

Read One Application

GET /applications/:app_id

curl --location --request GET 'https://api.paygate.africa/applications/:app_id' \
--header 'Content-Type: application/json' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/applications/:app_id")
  .header("Content-Type", "application/json")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/applications/:app_id')
  .headers({
    'Content-Type': 'application/json'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/:app_id');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/:app_id"

payload  = {}
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "app_id": ":app_id",
    "merchant_code": "1000000",
    "name": "AppTest 1",
    "description": "",
    "trx_commission_amount": 0,
    "website": "",
    "logo": "",
    "payments_success_url": "",
    "payments_failure_url": "",
    "createdAt": "2012-06-23T06:44:53.000Z"
}

GET BASE-URL/applications/:app_id

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
app_id string Your application id
merchant_code string Your merchant code
name string The provided name of the application
description string The provided description of your activity
trx_commission_amount number Fixed fees applied on successful transactions
website string Your website link
logo string Your application logo link
createdAt date The application creation date
keys array The set of keys needed for the application to authenticate

Update Application

PUT /applications/:app_id

curl --location --request PUT 'https://api.paygate.africa/applications/:app_id' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "This is the updated application description!"
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.put("https://api.paygate.africa/applications/:app_id")
  .header("Content-Type", "application/json")
  .body("{
    \"description\": \"This is the updated application description!\"
    }")
  .asString();

var unirest = require('unirest');
var req = unirest('PUT', 'https://api.paygate.africa/applications/:app_id')
  .headers({
    'Content-Type': 'application/json'
  })
  .send("{
    "description":"This is the updated application description!"
    }")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/:app_id');
$request->setRequestMethod('PUT');
$body = new http\Message\Body;
$body->append('{
    "description": "This is the updated application description!"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/:app_id"

payload = "{
  \"description\": \"This is the updated application description!\"
  }"
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "app_id": ":app_id",
    "merchant_code": ":merchant_code",
    "name": "AppTest 1",
    "description": "This is the updated application description!",
    "trx_commission_amount": 0,
    "website": "https://sandboxtest.paygate.africa",
    "logo": "",
    "createdAt": "2020-06-23T15:31:48.000Z",
    "changes": [
        {
            "op": "update",
            "val": "This is the updated application description!",
            "oldVal": "Ceci est une application de test"
        }
    ]
}

PUT BASE-URL/applications/:app_id

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
name string false Application name
description string false Activity description
logo string false Application logo link
website string false Application website link

Response Object

Parameter Type Description
app_id string Your application id
merchant_code string Your merchant code
name string The provided name of the application
description string The provided description of your activity
trx_commission_amount number Fixed fees applied on successful transactions
website string Your website link
logo string Your application logo link
createdAt date The application creation date
changes array An array of data spotting the changes that have been persisted

Update Application Keys

PUT /applications/:app_id/keys

curl --location --request PUT 'https://api.paygate.africa/applications/:app_id/keys' \
--header 'Content-Type: application/json' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.put("https://api.paygate.africa/applications/:app_id/keys")
  .header("Content-Type", "application/json")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('PUT', 'https://api.paygate.africa/applications/:app_id/keys')
  .headers({
    'Content-Type': 'application/json'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/:app_id/keys');
$request->setRequestMethod('PUT');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/:app_id/keys"

payload  = {}
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "client_id": "CLIENT_ID",
    "client_secret": "CLIENT_SECRET",
    "refresh_token": "REFRESH_TOKEN",
    "createdAt": "2012-06-23T12:56:12.000Z"
}

PUT BASE-URL/applications/:app_id/keys

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
client_id string Your application client id
client_secret string Your application client secret
refresh_token string Your application refresh token
createdAt date The keys creation date

Read Keys

GET /applications/:app_id/keys

curl --location --request GET 'https://api.paygate.africa/applications/:app_id/keys' \
--header 'Content-Type: application/json' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/applications/:app_id/keys")
  .header("Content-Type", "application/json")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/applications/:app_id/keys')
  .headers({
    'Content-Type': 'application/json'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/:app_id/keys');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/:app_id/keys"

payload  = {}
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "client_id": "CLIENT_ID",
    "client_secret": "CLIENT_SECRET",
    "refresh_token": "REFRESH_TOKEN",
    "createdAt": "2012-06-23T12:56:12.000Z"
}

GET BASE-URL/applications/:app_id/keys

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
client_id string Your application client id
client_secret string Your application client secret
refresh_token string Your application refresh token
createdAt date The keys creation date

Add Callback URLs

POST /applications/links

curl --location --request POST 'http://localhost:3000/applications/links' \
--header 'Content-Type: application/json' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "payments_success": "http://localhost:3000/applications/payment_success",
    "payments_failure": "http://localhost:3000/applications/payment_failure",
    "ipn": "http://localhost:3000/applications/ipn"
}
'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://localhost:3000/applications/links")
  .header("Content-Type", "application/json")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .body("{
    \"payments_success\": \"http://localhost:3000/applications/payment_success\",
    \"payments_failure\": \"http://localhost:3000/applications/payment_failure\",
    \"ipn\": \"http://localhost:3000/applications/ipn\"
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'http://localhost:3000/applications/links')
  .headers({
    'Content-Type': 'application/json',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .send(JSON.stringify({
    "payments_success":"http://localhost:3000/applications/payment_success",
    "payments_failure":"http://localhost:3000/applications/payment_failure",
    "ipn":"http://localhost:3000/applications/ipn"
    }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('http://localhost:3000/applications/links');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "payments_success": "http://localhost:3000/applications/payment_success",
    "payments_failure": "http://localhost:3000/applications/payment_failure",
    "ipn": "http://localhost:3000/applications/ipn"
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "http://localhost:3000/applications/links"

payload = "{
  \"payments_success\": \"http://localhost:3000/applications/payment_success\",
  \"payments_failure\": \"http://localhost:3000/applications/payment_failure\",
  \"ipn\": \"http://localhost:3000/applications/ipn\"
  }"
headers = {
  'Content-Type': 'application/json',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "payments_success": "http://localhost:3100/payments_success",
    "payments_failure": "http://localhost:3100/payments_failure",
    "ipn": "http://localhost:3100/ipn",
    "createdAt": "2020-08-30T13:43:24.000Z"
}

POST BASE-URL/applications/links

Request Headers

Parameter Required Value
Content-Type false application/json
app_id true Your application id

Request Body

Parameter Type Required Description
payments_success string false Payment successful link
payments_failure string false Payment failure link
ipn string false Instant payment notification link

Response Object

Parameter Type Description
payments_success string Payment successful link
payments_failure string Payment failure link
ipn string Instant payment notification link
createdAt date The application creation date

IPN Object

Parameter Type Description
app_id string Application unique identifier
transaction_id string Transaction unique identifier
amount string Transaction amount
currency date Currency
order_ref date Order reference id
payment_channel date Payment channel used by customer
fees date Applied platform fees
commission date Applied platform commission
status date Transaction payment status

Read Callback URLs

GET /applications/links

curl --location --request GET 'http://localhost:3000/applications/links' \
--header 'Content-Type: application/json' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token' 
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://localhost:3000/applications/links")
  .header("Content-Type", "application/json")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .body("")
  .asString();
var unirest = require('unirest');
var req = unirest('GET', 'http://localhost:3000/applications/links')
  .headers({
    'Content-Type': 'application/json',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('http://localhost:3000/applications/links');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "http://localhost:3000/applications/links"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "payments_success": "http://localhost:3100/payment_success",
    "payments_failure": "http://localhost:3100/payment_failure",
    "ipn": "http://localhost:3100/ipn",
    "createdAt": "2020-08-30T13:43:24.000Z"
}

GET BASE-URL/applications/links

Request Headers

Parameter Required Value
Content-Type false application/json
app_id true Your application id

Request Body

Parameter Type Required Description
payments_success string false Payment successful link
payments_failure string false Payment failure link
ipn string false Instant payment notification link

Response Object

Parameter Type Description
payments_success string Payment successful link
payments_failure string Payment failure link
ipn string Instant payment notification link
createdAt date The application creation date

Update Callback URLs

PUT /applications/links

curl --location --request PUT 'http://localhost:3000/applications/links' \
--header 'Content-Type: application/json' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "payments_success": "http://localhost:3000/applications/payment_success",
    "payments_failure": "http://localhost:3000/applications/payment_failure",
    "ipn": "http://localhost:3000/applications/ipn"
}
'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.put("http://localhost:3000/applications/links")
  .header("Content-Type", "application/json")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .body("{
    \"payments_success\": \"http://localhost:3000/applications/payment_success\",
    \"payments_failure\": \"http://localhost:3000/applications/payment_failure\",
    \"ipn\": \"http://localhost:3000/applications/ipn\"
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('PUT', 'http://localhost:3000/applications/links')
  .headers({
    'Content-Type': 'application/json',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .send(JSON.stringify({
    "payments_success":"http://localhost:3000/applications/payment_success",
    "payments_failure":"http://localhost:3000/applications/payment_failure",
    "ipn":"http://localhost:3000/applications/ipn"
    }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('http://localhost:3000/applications/links');
$request->setRequestMethod('PUT');
$body = new http\Message\Body;
$body->append('{
    "payments_success": "http://localhost:3000/applications/payment_success",
    "payments_failure": "http://localhost:3000/applications/payment_failure",
    "ipn": "http://localhost:3000/applications/ipn"
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "http://localhost:3000/applications/links"

payload = "{
  \"payments_success\": \"http://localhost:3000/applications/payment_success\",
  \"payments_failure\": \"http://localhost:3000/applications/payment_failure\",
  \"ipn\": \"http://localhost:3000/applications/ipn\"
  }"
headers = {
  'Content-Type': 'application/json',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "payments_success": "http://localhost:3100/payment_success",
    "payments_failure": "http://localhost:3100/payment_failure",
    "ipn": "http://localhost:3100/ipn",
    "createdAt": "2020-08-30T13:43:24.000Z"
}

PUT BASE-URL/applications/links

Request Headers

Parameter Required Value
Content-Type false application/json
app_id true Your application id

Request Body

Parameter Type Required Description
payments_success string false Payment successful link
payments_failure string false Payment failure link
ipn string false Instant payment notification link

Response Object

Parameter Type Description
payments_success string Payment successful link
payments_failure string Payment failure link
ipn string Instant payment notification link
createdAt date The application creation date

Connect Application

POST /auth/connect/application

curl --location --request POST 'https://api.paygate.africa/auth/connect/application' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic token' \
--header 'app_id: APP-ID' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/auth/connect/application")
  .header("Content-Type", "application/json")
  .header("Authorization", "Basic token")
  .header("app_id", "APP-ID")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/auth/connect/application')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Basic token',
    'app_id': 'APP-ID'
  })
  .send(JSON.stringify({}))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/auth/connect/application');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Basic token',
  'app_id' => 'APP-ID'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/auth/connect/application"

payload = ""
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic token',
  'app_id': 'APP-ID'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "connect_token": "Bearer token",
    "refresh_token": ":refresh_token"
}

POST BASE-URL/auth/connect/application

Request Headers

Parameter Required Value
Content-Type false application/json
Authorization true Basic base64 ( client_id : client_secret ) cf here
app_id true application unique identifier

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
connect_token string The bearer token that will be used to authenticate requests
refresh_token string The refresh token that will be used to wake up connections

Invite Collaborator

POST /applications/:app_id/collabs

curl --location --request POST 'https://api.paygate.africa/applications/$2a$10$AxW6rChTuttfbVpZ5Bs9k./collabs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "firstname": "Collab",
    "lastname": "User",
    "email": "collab.user@paygate.africa",
  "permission": "guest"
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/applications/$2a$10$AxW6rChTuttfbVpZ5Bs9k./collabs")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer token")
  .body("{
    \"firstname\": \"Collab\",
    \"lastname\": \"User\",
    \"email\": \"collab.user@paygate.africa\",
    \"permission\": \"guest\"
    }")
  .asString();

var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/applications/$2a$10$AxW6rChTuttfbVpZ5Bs9k./collabs')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Bearer token'
  })
  .send(JSON.stringify({
      "firstname":"Collab",
      "lastname":"User",
      "email":"collab.user@paygate.africa",
      "permission": "guest"
    }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/$2a$10$AxW6rChTuttfbVpZ5Bs9k./collabs');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
      "firstname": "Collab",
      "lastname": "User",
    "email": "collab.user@paygate.africa",
    "permission": "guest"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/applications/$2a$10$AxW6rChTuttfbVpZ5Bs9k./collabs"

payload = "{
  \"firstname\": \"Collab\",
  \"lastname\": \"User\",
  \"email\": \"collab.user@paygate.africa\",
  \"permission\": \"guest\",
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer token'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "firstname": "Collab",
    "lastname": "User",
    "email": "collab.user@paygate.africa",
    "createdAt": "2012-06-23T13:14:29.000Z"
}

POST BASE-URL/applications/:app_id/collabs

Request Headers

Parameter Required Value
Content-Type false application/json

Request Body

Parameter Type Required Description
firstname string true Collaborator firstname
lastname string true Collaborator lastname
email string true Collaborator email
permission string false Permissions given to the collaborator. Defaults to 'guest'

Available Applications Permissions

Permissions name Read app data List transactions Get balance Funds transfer Edit financial data Refund Manage collaborators
guest + - - - - - -
support + + - - - - -
accounting - + + + + + -
supervisor + + - - - - +
admin + + - - - + +

Response Object

Parameter Type Description
firstname string true
lastname string true
email string true
createdAt date Collaborator invitation date

List Collaborators

GET /applications/:app_id/collabs

curl --location --request GET 'https://api.paygate.africa/applications/:app_id/collabs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/applications/:app_id/collabs")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer token")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/applications/:app_id/collabs')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Bearer token'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/:app_id/collabs');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/:app_id/collabs"

payload  = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer token'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

[
  {
    "firstname": "Collab 1",
    "lastname": "User",
    "email": "collab1.user@paygate.africa",
    "createdAt": "2012-06-23T13:14:29.000Z"
}, {
    "firstname": "Collab 2",
    "lastname": "User",
    "email": "collab2.user@paygate.africa",
    "createdAt": "2015-06-23T13:14:29.000Z"
  }
]

GET BASE-URL/applications/:app_id/collabs

Request Headers

Parameter Required Value
Content-Type false application/json
Authorization true Bearer token

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
collaborators array An array of collaborators on this application

Delete Application

DELETE /applications/:app_id

curl --location --request DELETE 'https://api.paygate.africa/applications/:app_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data-raw ''
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.delete("https://api.paygate.africa/applications/:app_id")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer token")
  .body("")
  .asString();

var unirest = require('unirest');
var req = unirest('DELETE', 'https://api.paygate.africa/applications/:app_id')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Bearer token'
  })
  .send("")
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/applications/:app_id');
$request->setRequestMethod('DELETE');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/applications/:app_id"

payload  = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer token'
}

response = requests.request("DELETE", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{}

DELETE BASE-URL/applications/:app_id

Request Headers

Parameter Required Value
Content-Type false application/json
Authorization true Bearer token

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description

Transactions

Welcome to the heart of the system.

The process of creating your PayGate Application unlocks the possibility for you to charge your customers for what they'll order.

Transactions allows an authorized and connected application to communicate to PayGate details of customers carts allong with expected amounts to be charged. PayGate then checks information and returns to the application an object containing a transaction ID and a capture URL. The application needs to redirect the customer to the provided URL to finalize the payment. If you want to keep your customer on site, feel free to embed the capture_url within an iFrame.

In the end, PayGate will redirect the customer to the defined payment status page and securely communicate the outcome of the payment to the provided IPN (instant Payment Notification) URL so you can take appropriate actions.

An image is worth a thousand words

PayGate Transaction Flow

Request Transaction ID

POST /transactions

curl --location --request POST 'https://api.paygate.africa/transactions' \
--header 'Content-Type: application/json' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "amount": "100.00",
    "currency": "XOF",
    "payment_options": "preorder",
    "preorder_end_date": "2012-06-28T15:05:00.000Z",
    "order_ref": "3701",
    "items": 2,
    "cart":[{
        "product_name": "product 1",
        "product_code": "ADBFRT345",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    },{
        "product_name": "product 2",
        "product_code": "ADBZSER35",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    }]
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.paygate.africa/transactions")
  .header("Content-Type", "application/json")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .body("{
      \"amount\": \"100.00\",
      \"currency\": \"XOF\",
      \"payment_options\": \"preorder\",
      \"preorder_end_date\": \"2012-06-28T15:05:00.000Z\",
      \"order_ref\": \"3701\",
      \"items\": 2,
      \"cart\":[{
            \"product_name\": \"product 1\",
            \"product_code\": \"ADBFRT345\",
            \"quantity\": 1,
            \"price\": \"50.00\",
            \"total\": \"50.00\",
            \"image\": \"\",
            \"description\": \"\",
            \"note_1\": \"\",
            \"note_2\": \"\",
            \"note_3\": \"\",
            \"note_4\": \"\",
            \"note_5\": \"\"
        },{
            \"product_name\": \"product 2\",
            \"product_code\": \"ADBZSER35\",
            \"quantity\": 1,
            \"price\": \"50.00\",
            \"total\": \"50.00\",
            \"image\": \"\",
            \"description\": \"\",
            \"note_1\": \"\",
            \"note_2\": \"\",
            \"note_3\": \"\",
            \"note_4\": \"\",
            \"note_5\": \"\"
        }]
    }")
  .asString();
var unirest = require('unirest');
var req = unirest('POST', 'https://api.paygate.africa/transactions')
  .headers({
    'Content-Type': 'application/json',
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .send(JSON.stringify({
      "amount":"100.00",
      "currency":"XOF",
      "payment_options":"preorder",
      "preorder_end_date":"2012-06-28T15:05:00.000Z",
      "order_ref":"3701",
      "items":2,
      "cart":[{
          "product_name":"product 1",
          "product_code":"ADBFRT345",
          "quantity":1,
          "price":"50.00",
          "total":"50.00",
          "image":"",
          "description":"",
          "note_1":"",
          "note_2":"",
          "note_3":"",
          "note_4":"",
          "note_5":""
        },{
          "product_name":"product 2",
          "product_code":"ADBZSER35",
          "quantity":1,
          "price":"50.00",
          "total":"50.00",
          "image":"",
          "description":"",
          "note_1":"",
          "note_2":"",
          "note_3":"",
          "note_4":"",
          "note_5":""
        }]
    }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
    "amount": "100.00",
    "currency": "XOF",
    "payment_options": "preorder",
    "preorder_end_date": "2012-06-28T15:05:00.000Z",
    "order_ref": "3701",
    "items": 2,
    "cart":[{
        "product_name": "product 1",
        "product_code": "ADBFRT345",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    },{
        "product_name": "product 2",
        "product_code": "ADBZSER35",
        "quantity": 1,
        "price": "50.00",
        "total": "50.00",
        "image": "",
        "description": "",
        "note_1": "",
        "note_2": "",
        "note_3": "",
        "note_4": "",
        "note_5": ""
    }]
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/transactions"

payload = "{
    \"amount\": \"100.00\",
    \"currency\": \"XOF\",
    \"payment_options\": \"preorder\",
    \"preorder_end_date\": \"2012-06-28T15:05:00.000Z\",
    \"order_ref\": \"3701\",
    \"items\": 2,
    \"cart\":[{
        \"product_name\": \"product 1\",
        \"product_code\": \"ADBFRT345\",
        \"quantity\": 1,
        \"price\": \"50.00\",
        \"total\": \"50.00\",
        \"image\": \"\",
        \"description\": \"\",
        \"note_1\": \"\",
        \"note_2\": \"\",
        \"note_3\": \"\",
        \"note_4\": \"\",
        \"note_5\": \"\"
    },{
        \"product_name\": \"product 2\",
        \"product_code\": \"ADBZSER35\",
        \"quantity\": 1,
        \"price\": \"50.00\",
        \"total\": \"50.00\",
        \"image\": \"\",
        \"description\": \"\",
        \"note_1\": \"\",
        \"note_2\": \"\",
        \"note_3\": \"\",
        \"note_4\": \"\",
        \"note_5\": \"\"
    }]
}"
headers = {
  'Content-Type': 'application/json',
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "transaction_id": "TRANSACTION-ID",
    "amount": 100,
    "currency": "XOF",
    "order_ref": "3701",
    "payment_options": "preorder",
    "expiresAt": "2012-06-28T15:05:00.000Z",
    "preorder_end_date": "2012-06-28T15:05:00.000Z",
    "createdAt": "2012-06-24T15:05:48.000Z",
    "capture_url": "https://api.paygate.africa/transactions/TRANSACTION-ID/payment/capture"
}

POST BASE-URL/transactions

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description
amount number true Amount to bill
currency string true Currency iso code defaults to XOF
payment_options string false Set the desired payment option between "instant" or "preorder"
preorder_end_date date false Only required if payment option value is set to or contains "preorder" value
order_ref string false Allow merchants to add their own reference
items number false Number of items contained within the cart. Should be declared if cart is non empty and match the exact number of items in cart
cart array false Contains items details that will be displayed to customer at checkout

Transactions Payment Options

Option Name Description Time Range
instant Merchant requests customer to be debited at purchase 0 - 15 minutes
preorder Customer is debited for the order and merchant will be credited at delivery 3 - 30 days

Response Object

Parameter Type Description
transaction_id string The unique transaction id generated by the system
amount number Amount to bill
currency string Currency iso code defaults to XOF
order_ref string Allow merchants to add their own reference
payment_options string The desired payment option set
preorder_end_date date Preorder end date. Payment should be done prior this date
expiresAt date Payment expiration date
createdAt date Transaction creation date
capture_url url The link to redirect the customer for payment

List Transactions

GET /transactions/list

curl --location --request GET 'https://api.paygate.africa/transactions/list' \
--header 'Content-Type: application/json' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/transactions/list")
  .header("Content-Type", "application/json")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .asString();
var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/transactions/list')
  .headers({
    'Content-Type': 'application/json',
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions/list');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
import requests

url = "https://api.paygate.africa/transactions/list"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

[
    {
        "transaction_id": "TRANSACTION-ID1",
        "amount": 100,
        "currency": "XOF",
        "order_ref": "A15-65",
        "payment_options": "preorder",
        "expiresAt": "2012-06-24T09:27:15.000Z",
        "preorder_end_date": "2012-06-28T16:32:00.000Z",
        "createdAt": "2012-06-24T16:32:09.000Z",
        "cart": [
            {
                "product_code": "ADBZSER35",
                "product_name": "product 2",
                "price": 50,
                "image": "",
                "description": "",
                "quantity": 1,
                "total": 50,
                "note_1": "",
                "note_2": "",
                "note_3": "",
                "note_4": "",
                "note_5": "",
                "createdAt": "2012-06-24T16:32:09.000Z"
            },
            {
                "product_code": "ADBFRT345",
                "product_name": "product 1",
                "price": 50,
                "image": "",
                "description": "",
                "quantity": 1,
                "total": 50,
                "note_1": "",
                "note_2": "",
                "note_3": "",
                "note_4": "",
                "note_5": "",
                "createdAt": "2012-06-24T16:32:09.000Z"
            }
        ]
    },
    {
        "transaction_id": "TRANSACTION-ID2",
        "amount": 1000,
        "currency": "XOF",
        "order_ref": "B4-582",
        "payment_options": "preorder",
        "expiresAt": "2012-06-13T11:29:19.000Z",
        "preorder_end_date": "2012-06-17T11:14:00.000Z",
        "createdAt": "2012-06-13T11:14:40.000Z",
        "cart": [
            {}
        ]
    },
    ...
    {
        "transaction_id": "TRANSACTION-ID3",
        "amount": 500,
        "currency": "XOF",
        "order_ref": "C-1118",
        "payment_options": "preorder",
        "expiresAt": "2012-06-09T04:43:40.000Z",
        "preorder_end_date": "2012-06-13T16:41:00.000Z",
        "createdAt": "2012-06-09T16:41:40.000Z",
        "cart": [
            {}
        ]
    }
]

GET BASE-URL/transactions/list

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
transactions array Array of transactions

Read One Transaction

GET /transactions/:transaction_id

curl --location --request GET 'https://api.paygate.africa/transactions/TRANSACTION-ID' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/transactions/TRANSACTION-ID")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/transactions/TRANSACTION-ID')
  .headers({
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions/TRANSACTION-ID');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/transactions/TRANSACTION-ID"

payload = {}
headers = {
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "transaction_id": "TRANSACTION-ID",
    "amount": 100,
    "currency": "XOF",
    "order_ref": "3155",
    "payment_options": "preorder",
    "expiresAt": "2020-06-24T05:16:16.000Z",
    "preorder_end_date": "2020-06-28T17:01:00.000Z",
    "createdAt": "2020-06-24T17:01:30.000Z",
    "cart": [
        {
            "product_code": "ADBZSER35",
            "product_name": "product 2",
            "price": 50,
            "image": "",
            "description": "",
            "quantity": 1,
            "total": 50,
            "note_1": "",
            "note_2": "",
            "note_3": "",
            "note_4": "",
            "note_5": "",
            "createdAt": "2020-06-24T17:01:30.000Z"
        },
        {
            "product_code": "ADBFRT345",
            "product_name": "product 1",
            "price": 50,
            "image": "",
            "description": "",
            "quantity": 1,
            "total": 50,
            "note_1": "",
            "note_2": "",
            "note_3": "",
            "note_4": "",
            "note_5": "",
            "createdAt": "2020-06-24T17:01:30.000Z"
        }
    ]
}

GET BASE-URL/transactions/:transaction_id

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
transaction_id string The unique transaction id generated by the system
amount number Amount to bill
currency string Currency iso code defaults to XOF
order_ref string Allow merchants to add their own reference
payment_options string The desired payment option set
preorder_end_date date Preorder end date. Payment should be done prior this date
expiresAt date Payment expiration date
createdAt date Transaction creation date
cart array Contains the details of items ordered by the customers

Payment Status

GET /transactions/:transaction_id/payment

curl --location --request GET 'https://api.paygate.africa/transactions/TRANSACTION-ID/payment' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.paygate.africa/transactions/TRANSACTION-ID/payment")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .asString();

var unirest = require('unirest');
var req = unirest('GET', 'https://api.paygate.africa/transactions/TRANSACTION-ID/payment')
  .headers({
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions/TRANSACTION-ID/payment');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/transactions/TRANSACTION-ID/payment"

payload = {}
headers = {
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "transaction_id": "TRANSACTION-ID",
    "amount": 100,
    "currency": "XOF",
    "order_ref": "3715",
    "payment_options": "preorder",
    "expiresAt": "2020-06-26T02:54:47.000Z",
    "preorder_end_date": "2020-06-30T14:40:00.000Z",
    "createdAt": "2020-06-26T14:40:22.000Z",
    "payment": {
        "fees": 0,
        "commission": 0,
        "createdAt": "2020-06-26T15:05:21.000Z",
        "channel": "PAYMENT NAME",
        "status": "PENDING"
    }
}

GET BASE-URL/transactions/:transaction_id/payment

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
transaction_id string The unique transaction id generated by the system
amount number Amount to bill
currency string Currency iso code defaults to XOF
order_ref string Allow merchants to add their own reference
payment_options string The desired payment option set
preorder_end_date date Preorder end date. Payment should be done prior this date
expiresAt date Payment expiration date
createdAt date Transaction creation date
payment array Contains the payment details

Cancel Transaction

PUT /transactions/:transaction_id/cancel

curl --location --request PUT 'https://api.paygate.africa/transactions/TRANSACTION-ID/cancel' \
--header 'refresh_token: REFRESH-TOKEN' \
--header 'app_id: APP-ID' \
--header 'Authorization: Bearer token'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.put("https://api.paygate.africa/transactions/TRANSACTION-ID/cancel")
  .header("refresh_token", "REFRESH-TOKEN")
  .header("app_id", "APP-ID")
  .header("Authorization", "Bearer token")
  .asString();

var unirest = require('unirest');
var req = unirest('PUT', 'https://api.paygate.africa/transactions/TRANSACTION-ID/cancel')
  .headers({
    'refresh_token': 'REFRESH-TOKEN',
    'app_id': 'APP-ID',
    'Authorization': 'Bearer token'
  })
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });

<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.paygate.africa/transactions/TRANSACTION-ID/cancel');
$request->setRequestMethod('PUT');
$request->setOptions(array());
$request->setHeaders(array(
  'refresh_token' => 'REFRESH-TOKEN',
  'app_id' => 'APP-ID',
  'Authorization' => 'Bearer token'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

import requests

url = "https://api.paygate.africa/transactions/TRANSACTION-ID/cancel"

payload = {}
headers = {
  'refresh_token': 'REFRESH-TOKEN',
  'app_id': 'APP-ID',
  'Authorization': 'Bearer token'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

A successful response should be similar to this

{
    "transaction_id": "TRANSACTION-ID",
    "amount": 100,
    "currency": "XOF",
    "order_ref": "3715",
    "payment_options": "preorder",
    "expiresAt": "2018-06-26T02:54:47.000Z",
    "preorder_end_date": "2018-06-26T02:54:47.000Z",
    "createdAt": "2020-06-26T14:40:22.000Z",
}

PUT BASE-URL/transactions/:transaction_id/cancel

Request Headers

Parameter Required Value
Authorization true Application Bearer token
app_id true Application unique ID
Content-Type false application/json
refresh_token false Application refresh token, not mandatory but recommended to wake up session

Request Body

Parameter Type Required Description

Response Object

Parameter Type Description
transaction_id string The unique transaction id generated by the system
amount number Amount to bill
currency string Currency iso code defaults to XOF
order_ref string Allow merchants to add their own reference
payment_options string The desired payment option set
preorder_end_date date Preorder end date. Payment should be done prior this date
expiresAt date Payment expiration date
createdAt date Transaction creation date

Filters

Pagination

Let's say you have over 1000 transactions records and you want to list them. The system will only return the 49 newer transactions when requested ordered by creation date. In order to access the other transactions records, you can easily move between pages like so

GET BASE-URL/transactions/list?page=n

This way page 1 will return the 49 latest transactions, page 2 will return the 49 following up till the end.

Limits

Limits can be set to retrieve a specific set of rows from a defined cursor. Just think of them like the MySQL LIMIT clause. Let's say you want to retrieve only 10 transactions from the 15th position. Following the default logic, this will return you transactions from point 15 to 25. You can request them like so

GET BASE-URL/transactions/list?limit=cursor,rows

Sorting

You can decide to sort the way results appear based on an available column and in a reverse or chronological order just like in MySQL like so

GET BASE-URL/transactions/list?sort=column ASC|DESC

This will return the 49 lastest transactions sorted by amount in a chronological order

Status Codes

Codes Meaning
200 - 201 Success -- Action has been performed
204 No Content -- Empty response
400 Bad Request -- Your request is invalid.
403 Forbidden -- You do not have the right to access the resource
404 Not Found -- The specified resource could not be found.
429 Too Many Requests
500 Internal Server Error
502 Bad Gateway - Server is Unavailable
503 Service Unavailable -- We're temporarily offline for maintenance.

Contacts

Email: developers@paygate.africa
Website: www.PayGate.Africa