Payment API Gateway (v5.7.2)

Download OpenAPI specification:

Payment Gateway API Reference

This API is part of the our ecosystem. It allows you to make payments, find out the status of transactions and much more. Here you will find the latest documentation on setting up your solution.

Generating signature

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters from the payload are included in the order they were sent. The parameter signature should be excluded, of course, and added to the payload after generating.

Note: to generate a correct signature you need a secretKey received with other credentials.

PHP example

function calculateSignature(array $data, string $secretKey, string $currentParamPrefix = '', int $depth = 16, int $currentRecursionLevel = 0 ): string
{
    if ($currentRecursionLevel >= $depth) {
        throw new Exception('Recursion level exceeded');
    }

    $stringForSignature = '';
    foreach ($data as $key => $value) {
        if (is_array($value)) {
                $stringForSignature .= calculateSignature(
                $value,
                $secretKey,
                "$currentParamPrefix$key.",
                    $depth,
                $currentRecursionLevel + 1
            );
      } else if ($key !== 'signature') {
                $stringForSignature .= "$currentParamPrefix$key" . $value;
      }
   }

    if ($currentRecursionLevel == 0) {
      return strtolower(hash_hmac('sha512', $stringForSignature, $secretKey));
    } else {
      return $StringForSignature;
    }
 }

$postData = [
  'merchant_id' => 'fffed61be9780b97c5e4c65e4e07bb6b',
  'provider_id' => 10,
  'client_id' => '080000000',
  'country' => 'KE',
  'order_id' => 'order_3444298767545',
  'amount' => 1000,
  'currency' => 'CDF',
  'callback_url' => 'https://my.callback.url'
];

$secretKey = "cf11635572c1e8d77297207152dc0791ad91f22b32d23c758ce3ba2637202ad8f7290ba41f2243cccf32edde1dfb8bf0f5dea62525309e293b3adb2c76eed6a5";

$signature = calculateSignature($postData, $secretKey);

$postData['signature'] = $signature;

Examples in other languages are available on request

Safaricom Paybill

What is Safaricom Paybill?

The Pay Bill service is a mobile payments service that allows your organization to collect money on a regular basis from your customers through M-PESA.

How does Safaricom Paybill work?

  • Client goes to M-PESA on the client’s phone SIM Menu or uses M-PESA app.
  • Client selects Payment Services.
  • Client chooses PayBill and enters Safaricom PostPay Bill number / ShortCode (XXXXXX).
  • Client enters the mobile number to make payment.
  • Client inputs the amount client wishes to pay.
  • In the app, Client may indicate his account/wallet number to the Account number field.
  • Client keys in client’s M-PESA PIN.
  • Client confirms details are correct and presses OK.
  • Safaricom sends a callback to us about this transaction.
  • We sends a callback to Merchant about this transaction.
  • Transaction information displays on Safaricom Backoffice.
  • Transaction information displays on our Backoffice.

Paybill callback URL

The merchant should provide their callback URL to the our tech team to receive information about such transactions.

Paybill callback format

Name of field Type Description Example
extra object A list of values
billRefNumber integer This field contains the parameter from Account number field in the payment form on Lipa Na M-PESA, which is indicated by the Customer.The Merchant has to inform the Customer to indicate the identification number of their account with the Merchant system. 555555555
firstName string Client’s first name (received from Safaricom) ALEX
amount number Amount to pay 100
result object Operation result
code integer Result code of the operation (0 - success) 0
message string Short description of the result code OK
status integer Status of the performed operation 2
currency string Currency code in ISO 4217 format KES
order_id string For paybills transactions, this unique value is generated by us for each Operation. Max length is 128 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “_” (underscore character), “-” (hyphen), “:” (colon), “.” (dot). For example, GUID or TIMESTAMP can be used as an order_id. This parameter provides API idempotency. It means that requests with identical nonce from the same transaction initiator will have identical responses, and the corresponding operation won’t be repeated. In the backoffice, it may be found in the Merchant Trnx ID field 2023-03-15-15-25-12-255432
signature string Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course
service_id integer Unique ID of the service in the Payment gateway 1
customer_id string Customer’s phone number of 12 symbols. Client's phone should start from the country code: 254ХХХХХХХХХ (part of the number is returned as asterisk) 2547 ***** 000
merchant_id string Unique Merchant ID received during the merchant registration 555222hhh555fff999rrr444qqq222
provider_id integer Provider ID: 40: Safaricom 40
destination_id integer Transaction destination ID (merchant’s shortcode) 7000000
operation_type integer For paybills - 32 32
transaction_id string Usually generated by Safaricom. Empty for paybills
provider_result object
code integer Result code of the operation from the provider 0
message string Result description from the provider OK
service_version string Payment gateway service version used for the operation
transaction_ref string Transaction number registered in Safaricom (RRN). This field could be empty RBQ0000000
service_date_time string Payment gateway timestamp of the operation 2023-03-03 13:33:33.333333

Paybill callback example

{
 "merchant_id": "555222hhh555fff999rrr444qqq222",
 "operation_type": 32,
 "customer_id": "2547 ***** 000",
 "amount": 100,
 "currency": "KES",
 "order_id": "2023-03-15-15-25-12-255432",
 "transaction_id": "",
 "transaction_ref": "RBQ0000000",
 "status": 2,
 "provider_id": 40,
 "destination_id": "7000000",
 "result": {
     "code": 0,
     "message": "OK"
 },
 "provider_result": {
     "code": 0,
     "message": ""
 },
 "service_id": 1,
 "service_version": "1.03/1.0|1.0/1.26|1.0/1.0|1.01/1.0|1.01/1.0||1.01/1.27",
 "service_date_time": "2023-03-03 13:33:33.333333",
 "extra": {
     "BillRefNumber": "555555555",
     "FirstName": "ALEX",
     "MiddleName": "",
     "LastName": ""
 },
 "signature": "sdfkdfpogu9550603etgkdopftege34t0i5rggdftoe0tgskguo09w6t"
     }

Paybill Validation

The parameter that is directly involved in the validation is PayBillRefNumber

To be able to pre-verify payments via paybill, the Merchant needs to add another URL in his system to which requests will be sent (the same as on paybill callback. This URL must be reported to us. The Merchant will be able to verify the validity of this request (for example, the existence of the customer's account number in the Merchant's system) and send a response to it. A response with the code=0 means that the validation has been completed and the payment can be credited; any other response means that the transaction should not be completed, and a request to cancel the payment will be sent to Safaricom. In order for the response to be counted as confirmation, it has to contain a JSON with "code":0. Any other data will be ignored.

Example:

{"code":0,"status":"ok"}

Status Codes

The parameters below will be obtained by a status query

Code Name Description
-1 undefined Operation status is undefined (for example in an error situation)
0 initiated Operation is initiated
1 in progress Operation is in progress
2 success Operation is successful
3 failed Operation is failed
4 cancelled Operation is cancelled
5 cancelled partially Operation is cancelled partially (this status is related to POS payments)
6 in_transit Operation is in transition (for example for withdrawal operation it means that cash was held but wasn’t received by the customer, this status also is related to POS payments)

Operation Types

Depending on the type of request you may see the following code

You can see this parameter in the callback

Code Operation
16 payment_b2c
17 payment_c2b

Available currencies

Code Note
KES Kenya, betting and non-betting merchants
XOF Ivory Coast, Senegal
XAF Cameroon
NGN Nigeria

Responses for confirmation requests have the same format as original operation responses.

Callbacks

C2b transaction status is sent via callback because it needs a confirmation by client done asynchronously. Usually the callback should be sent in 2-3 minutes maximum. In case of missing callback there is a way to get the transaction status using API method status. It needs the order ID as an parameter and returns a status of the performed transaction.

Response for callback

Payment gateway considers the Merchant system response as successful if HTTP 200 was received.

POS terminals usage case

In the case of POS terminals usage Merchant tech system receives callbacks after every successful operation performed on POS. The merchant_id parameter contains a unique identifier of the POS on which the operation was performed. The operation_type parameter contains a type of performed operation. So operations are initiated on POS terminals and information about successful ones is sent to the Merchant tech system with callbacks to configured URL.

Payment Methods

Simulator

Provider ID Provider Name Notes
14 Simulator For testing purposes

During tests runs, using 14 provider ID (simulator) the callback is not returned and the transaction remains in the "in progress" status and if successful you will see in the response

{
  "order_id": "54321",
  "transaction_id": "12345",
  "transaction_ref": "",
  "status": 1,
  "result": {
      "code": 0,
      "message": "OK"
  },
  "provider_result": {
      "code": -8888,
      "message": "Good"
  },
  "service_id": 1,
  "service_version": "1.03/1.14|1.0/1.26|1.0/1.0|1.01/1.01|1.01/1.01||1.01/1.27",
  "service_date_time": "2023-05-15 10:00:00.000000",
  "confirm_type": 0
}

Cameroon

Provider ID Provider Name Notes
2415 MTN Check provider id with your manager
2414 Orange Check provider id with your manager

237000000000 - This is the format of the phone number you have to send in the payment requests.

For 2414, 2415:

C2B:

  1. Customer initiates the payment on Merchant side
  2. Merchant sends request to the platform (POST payment_c2b)
  3. Customer gets push from operator and confirm the operation
  4. Merchant gets a callback (or requests the status) with the final state of the operation

B2C:

  1. Customer initiates the payment on Merchant side and set extra data extra->customer_name
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation
c2b minimum b2c minimum Maximum c2b transaction limit Maximum b2c transaction limit
XAF 100.00 XAF 50.00 XAF 500'000.00 XAF 1'000'000.00

Kenya

Provider ID Provider Name Notes
2425 M-pesa Safaricom Check provider id with your manager

For 2425:

  • For C2B payments you should send a customer full name and customer email in the payment requests. Parameters extra->customer_name and extra->customer_email. Please see the example in the API Methods section.
  • For B2C payments you should send a customer full name and customer email in the payment requests. Parameters extra->customer_name and extra->customer_email. Please see the example in the API Methods section.
c2b minimum b2c minimum Maximum transaction limit
KES 1.00 KES 250.00 KES 150000.00

Ivory Coast

Provider ID Provider Name Notes
2406 MTN Check provider id with your manager
2408 Moov Check provider id with your manager
2407 Orange Check provider id with your manager
2409 Wave Check provider id with your manager

2250000000000 - This is the format of the phone number you have to send in the payment requests.

For 2406,2408:

C2B

  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_c2b)
  3. Customer gets push from operator and confirm the operation
  4. Merchant gets a callback (or requests the status) with the final state of the operation

B2C

  1. Customer initiates the payment on Merchant side and set extra data customer_name
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation

For 2407:

C2B

  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_c2b)
  3. Merchant gets the status of the operation (POST status) and gets extra parameters from the response customer_redirect
  4. Merchant redirects the customer to the page from the customer_redirect url
  5. Customer gets SMS\WhatApp message with OTP
  6. Customer confirm the operation by OTP on the page
  7. Customer gets push from operator and confirm the operation
  8. Merchant gets a callback (or requests the status) with the final state of the operation

B2C

  1. Customer initiates the payment on Merchant side and set extra data customer_name
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation

For 2409:

C2B:

  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_c2b)
  3. The merchant gets a redirect_url
  4. Merchant redirect Customer to provider payment page
  5. Customer makes a payment on the page
  6. Merchant gets a callback (or requests the status) with the final state of the operation

B2C:

  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation

For 2406, 2407, 2408, 2409:

c2b minimum b2c minimum Maximum transaction limit
XOF 100.00 XOF 100.00 XOF 500 000.00

Nigeria

Provider ID Provider Name Notes
2442, 2446, 2447, 2448 Bank Transfer Check provider id with your manager
2441 Bank Card Check provider id with your manager
2444, 2449 Opay Check provider id with your manager
2445, 2450, 2452 PalmPay Check provider id with your manager
2443, 2451, 2453 Pay Attitude Check provider id with your manager

2340000000000 - This is the format of the phone number you have to send in the payment requests.

Please note that on channels 2442, 2443, 2444, 2445, users have the opportunity to pay the wrong amount using their details, as well as make payments several times. To avoid discrepancies in amounts, lengthy processing of transactions on these channels and other difficulties, we recommend that you create an information board for users. Please warn in the text that the details are used only once and only for the stated amount. In other cases, the transaction processing time may take a very long time. For example, to be convincing, you can warn about the high probability of losing funds if these rules are violated

Flow for 2441 works only through the payment page, a description of the payment process and integration implementation is described in the payment page section

Flow for bank transfer

There are two methods for performing bank transfers in the C2B format: either by obtaining the account details directly or by using a link to the provider’s payment page. In both cases, retrieving the payment information requires requesting the status following the synchronous API response. These methods are described in detail in the sections below

Provider_ids redirecting to Provider payment pages: 2446, 2453, 2452

C2B:

  1. Customer initiates the payment on Merchant side
  2. Merchant sends C2B request to the platform where customer_id should be phone number
    In the extra parameters are specified:
    • customer_email
    • customer_name
  3. Merchant gets the status of the operation and extra data customer_redirect
    Example of a user redirect link:
"extra": 
{
"customer_redirect": "https://checkout.provider.com/202511131111MqKRft39377/pay"
}, 
  1. Merchant redirect Customer to provider page
  2. Customer makes a payment from their bank using the payment details
  3. Merchant gets a callback (or requests the status) with the final state of the operation

Provider_ids Returning Bank Details for C2B Payments: 2442, 2443, 2444, 2445, 2447, 2448, 2449, 2450, 2451

The key characteristic of this payment type is that for C2B payments, a status request after a synchronous response returns the bank details required by the end user to complete the payment via a banking app

C2B:

  1. The customer initiates the payment on the merchant side and sets extra data depending on the provider_id
Provider_id Empty customer_email customer_name Phone in customer_id return_url
2442, 2443, 2444, 2445 *
2448, 2449, 2450, 2451 *
2447 * *
  1. Merchant sends C2B request to the platform
  2. Platform returns temporary bank account details in the API response in status request (extra parameters) * account_number * bank_name * account_name
    Please note that the exact parameter names may differ slightly depending on the bank, so it is correct to display the entire extra section from the status request result to the user, for example:
"extra": 
{
"account_name": "MONEY TECH – LTD",
"account_number": "9999793854",
"bank_name": "GLOBAL BANK",
"transfer_amount": "1550"
}, 
  1. Merchant displays these bank details to the Customer.
  2. Customer makes a bank transfer to the provided details from their wallet.
  3. Merchant gets a callback with the final state of the operation once the funds are received.

B2C Opay, PalmPay, Pay Attitude:

  1. Customer initiates the payment on Merchant side and set extra data of their OPay, PalmPay or Pay Attitude bank account where customer_id is bank account
    In the extra parameters are specified:
    Provider_id bank_code customer_email customer_name customer_phone
    2443,2444,2445,2451,2449,2450,2452,2453 * *
  2. Merchant sends B2C request to the platform
  3. Customer receives funds to their bank account in OPay, PalmPay or Pay Attitude
  4. Merchant gets a callback (or requests the status) with the final state of the operation

B2C Payments for universal bank transfer

  1. Customer initiates the withdrawal on Merchant side.

  2. Merchant receives the list of available banks and its codes via get banks API Method

  3. Customer selects on the Merchant’s side the Bank and specifies their recipient’s bank account

  4. Merchant sends B2C request to the platform where customer_id is customer bank account number and sets extra data * bank_code got from get banks API Method response * Extra parameters used:

    Provider_id bank_code customer_email customer_name customer_phone
    2448, 2442 * *
    2447 *
    2446 * * *
  5. Platform transfers funds to the Customer's bank account

  6. Merchant gets a callback from the platform with the final state of the operation

A typical example of a request involving extra parameters, including those responsible for payment security:

  {
  "merchant_id":"e0fecd91fcb24f348048193b3fb34875ba3722b4",
  "order_id":"1234567890",
  "customer_id":"1628095497",
  "customer_user_id": "user-123456",
  "amount":"1000.00",
  "currency":"NGN",
  "provider_id":2447,
  "extra":{
    "customer_name":"Name Lastname",
    "customer_email": "[email protected]",
    "bank_code":"0007",
    "customer_ip": "203.0.113.45",
    "customer_phone": "254700000001",
    "customer_doc_type": "ID",
    "customer_doc_number": "A123456789"
  },
  "signature":"d7d6d76b0e22c6f9d369fa6t7cf5a05beebb9c80843e"
}

Limits

Provider_id c2b minimum b2c minimum Maximum transaction limit
2448, 2449, 2450, 2451 NGN 100.00 NGN 100.00 NGN 200'000.00
2447 NGN 50.00 NGN 50.00 NGN 100'000.00
2442, 2443, 2444, 2445 NGN 100.00 NGN 1000.00 NGN 200'000.00
2446, 2453, 2452 NGN 100.00 NGN 100.00 NGN 10 000 000.00
2441 NGN 100.00 NGN 100.00 NGN 1 000 000.00

Senegal

Provider ID Provider Name Notes
2410 Orange Check provider id with your manager
2411 Free Money Check provider id with your manager
2412 EMoney Check provider id with your manager
2413 Wave Check provider id with your manager

221700000000 - This is the format of the phone number you have to send in the payment requests.

2411, 2412:

C2B:
  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_c2b)
  3. Customer gets push from operator and confirm the operation
  4. Merchant gets a callback (or requests the status) with the final state of the operation
B2C:
  1. Customer initiates the payment on Merchant side and set extra data customer_name
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation

2410:

C2B:
  1. Customer initiates the payment on Merchant side and set extra data customer_name
  2. Merchant sends request to the platform (POST payment_c2b)
  3. Customer gets push from operator and confirm the operation
  4. Merchant gets a callback (or requests the status) with the final state of the operation
B2C:
  1. Customer initiates the payment on Merchant side and set extra data customer_name
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation

2413:

C2B:

  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_c2b)
  3. The merchant receives a redirect_url via a status request
  4. Merchant redirect Customer to provider payment page
  5. Customer makes a payment on the page
  6. Merchant gets a callback (or requests the status) with the final state of the operation

B2C:

  1. Customer initiates the payment on Merchant side and set extra data customer_name and customer_email
  2. Merchant sends request to the platform (POST payment_b2c)
  3. Customer receives funds to their mobile number
  4. Merchant gets a callback (or requests the status) with the final state of the operation

For 2410, 2411, 2412, 2413:

c2b minimum b2c minimum Maximum transaction limit
XOF 100.00 XOF 100.00 XOF 500'000.00

Payment Page

Payment Page allows to avoid the user interface and payment forms developing on the merchant’s side for each payment method. The Merchant only needs to redirect the Customer to the payment page, where they can enter their specific data for the selected payment method. The payment page can be opened in a pop-up window, an iframe or a separate browser tab.
Merchant needs to append some required parameters to the query url, and some optional ones. The optional parameters allow merchant to pre-fill some data in the url, or let the customer enter it on the payment page themselves.
URL example with the pre-filled customer’s data https://hpp.vukapay.io/example.php
After the redirect merchant needs to request the status of the initiated payment and also wait the callback with the final status. Status request and callbacks formats are described on the API Methods page.
Signature generating for the redirect URL example:


function calculateSignature($data, $secret)
{
    $signed = '';

    foreach ($data as $key => $value)
    {
        $signed .= $key.$value;
    }

    return strtolower(hash_hmac('sha512', $signed, $secret));
}

$data = [
  'merchant_id' => 'fffed61be9780b97c5e4c65e4e07bb6b',
  'order_id' => 'order_3444298767545',
  'customer_id' => '0000000000', //For card payments only
  'country' => 'NGA', // For bank transfer only
  'amount' => 101, //For card payments only
  'currency' => 'NGN',
  'provider_id' => 5000,
  'operation' => 'c2b',
  'type' => 'bank_transfer',
  'callback_url' => 'https://my.callback.url'
];

$secretKey = "cf11635572c1e8d77297207152dc0791ad91f22b32d23c758ce3ba2637202ad8f7290ba41f2243cccf32edde1dfb8bf0f5dea62525309e293b3adb2c76eed6a5";

$signature = calculateSignature($data, $secretKey);

echo $signature;

// signature: 9826c5e89ff6386e7bbb5263a4fbd41ed35eb2fc7c58650be487db14f066b0a650b1980762575ad296b0cbac1745f6a5faeb64cacd2756ccff95b52ba08259d7
// result query: https://hpp.vukapay.io/?merchant_id=fffed61be9780b97c5e4c65e4e07bb6b&order_id=order_3444298767545&country=NGA&currency=NGN&provider_id=5000&operation=c2b&type=bank_transfer&callback_url=https://my.callback.url&signature=9826c5e89ff6386e7bbb5263a4fbd41ed35eb2fc7c58650be487db14f066b0a650b1980762575ad296b0cbac1745f6a5faeb64cacd2756ccff95b52ba08259d7

This payment page https://hpp.vukapay.io/example.php is only a test example, it should be implemented on the merchant side with only the data that the user must enter. For example, it can only be email, name and amount.

If the data is entered incompletely or incorrectly, the user will see the form:

Payment Page

After correct filling out all the form fields, including your credentials, you can check the "Print link:" box to see the link the user will be redirected to to continue payment, or simply click the "send to payment page" button so that the request will be sent to the system, and the user will be redirected to the web-page, where it is necessary to specify card details or get bank details for payment

Please note that the payment page is currently mandatory only in Nigeria for bank cards channel 2441.

C2B query url parameters for Payment page section:

Name Is required Value Description
merchant_id required Unique Merchant ID received during the merchant registration
customer_id required (for card)
order_id required The unique value is generated by the transaction initiator for each Operation. Max length is 128 symbols. Min 11 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “-” (hyphen). Allowed symbols: [a-z], [A-Z], [0-9], “-” (hyphen). Important - underscore ("_") is not allowed
country required (for bank transfer) NG Country code in ISO 3166-1 alpha-2 format
currency required NGN Currency code in ISO 4217 format from the list of availabe currencies
provider_id required 2441 Provider identifier
operation required (for bank transfer) c2b Operation type
type required bank_transfer/card Provider type
callback_url not required URL to notify the merchant via callback. Callback structure you may see in C2B Online Payments.
email not required Customer email
name not required Customer full name
amount required (for card) Amount to pay
customer_user_id required User account number in the merchant system
customer_ip required Format 8.8.8.8 User's IP address
doc_type required intl_passport, driving_license, national_id
doc_number required 123456789 Document number
signature required Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found below

Online Payments

Cashless payment from the customer to the merchant

path Parameters
public_id
required
string
Example: f54ec96649be11ebb3780242ac130002

Merchant public ID

Request Body schema: application/json
required

Parameters to initiate a customer to the merchant payment

merchant_id
required
string (merchantIdDef)

Unique Merchant ID received during the merchant registration

customer_id
required
string (customerIdDef)

Customer ID (usually mobile phone number of the customer)

order_id
required
string (orderIdDef)

The unique value is generated by the transaction initiator for each Operation. Max length is 128 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “_” (underscore character), “-” (hyphen), “:” (colon), “.” (dot). For example, GUID or TIMESTAMP can be used as an order_id. This parameter provides API idempotency. It means that requests with identical nonce from the same transaction initiator will have identical responses and The corresponding operation won’t be repeated.

amount
required
string

Amount to pay, should be in format with two digits after point

currency
required
string (currencyDef)

Currency code in ISO 4217 format from the list of availabe currencies

country
string (countryDef)

Country code in ISO 3166-1 alpha-2 format as defined in the payment providers

callback_url
string

URL to notify the merchant via callback. Recommended

provider_id
required
integer (providerDef)
Enum: 14 40

Provider ID. Can be one of the option from this list.

object

Extra parameters

signature
required
string (signatureDef)

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found here

Responses

Callbacks

Request samples

Content type
application/json
{
  • "merchant_id": "e0fecd91fcb24f348048193b3fb34875ba3722b4",
  • "customer_id": "0900000001",
  • "order_id": "16280954971628095497",
  • "amount": "100.00",
  • "currency": "CDF",
  • "country": "KE",
  • "callback_url": "https://example.com/callback",
  • "provider_id": 14,
  • "extra": {
    },
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Response samples

Content type
application/json
{
  • "order_id": "16280954971628095497",
  • "transaction_id": "732007046722",
  • "transaction_ref": "MP.33234.342.CP33",
  • "status": 2,
  • "result": {
    },
  • "provider_result": {
    },
  • "service_id": 1,
  • "service_version": 11.1,
  • "service_date_time": "2020-11-25 10:08:32.832969"
}

Callback payload samples

Callback
POST: Asynchronous notification of the merchant about the last performed transaction
Content type
application/json
{
  • "transaction_id": "1234567",
  • "order_id": "16280954971628095497",
  • "service_id": 12345,
  • "service_version": "5.2.0",
  • "service_date_time": "2020-11-25 10:08:32.832969",
  • "result": {
    },
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Cashless payment from the merchant to the customer.

Cashless payment from the merchant to the customer. If the confirm_type response parameter is a non-zero merchant, send the second payment_b2c request with confirmation data according to the section Confirmation Types.

path Parameters
public_id
required
string
Example: f54ec96649be11ebb3780242ac130002

Merchant public ID

Request Body schema: application/json
required

Parameters to initiate the merchant to the customer payment

merchant_id
required
string (merchantIdDef)

Unique Merchant ID received during the merchant registration

customer_id
required
string (customerIdDef)

Customer ID (usually mobile phone number of the customer)

order_id
required
string (orderIdDef)

The unique value is generated by the transaction initiator for each Operation. Max length is 128 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “_” (underscore character), “-” (hyphen), “:” (colon), “.” (dot). For example, GUID or TIMESTAMP can be used as an order_id. This parameter provides API idempotency. It means that requests with identical nonce from the same transaction initiator will have identical responses and The corresponding operation won’t be repeated.

amount
required
string

Amount to pay, with two digits after point

currency
required
string (currencyDef)

Currency code in ISO 4217 format from the list of availabe currencies

country
string (countryDef)

Country code in ISO 3166-1 alpha-2 format as defined in the payment providers

callback_url
string

URL to notify the merchant via callback

provider_id
required
integer (providerDef)
Enum: 14 40

Provider ID. Can be one of the option from this list.

object

Extra parameters

signature
required
string (signatureDef)

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found here

Responses

Request samples

Content type
application/json
{
  • "merchant_id": "e0fecd91fcb24f348048193b3fb34875ba3722b4",
  • "customer_id": "0900000001",
  • "order_id": "16280954971628095497",
  • "amount": "100.00",
  • "currency": "CDF",
  • "country": "KE",
  • "callback_url": "https://example.com/callback",
  • "provider_id": 14,
  • "extra": {
    },
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Response samples

Content type
application/json
{
  • "order_id": "16280954971628095497",
  • "transaction_id": "532007056722",
  • "transaction_ref": "",
  • "status": 2,
  • "result": {
    },
  • "provider_result": {
    },
  • "service_id": 11,
  • "service_version": 11.1,
  • "service_date_time": "2020-11-25 10:08:32.832969",
  • "confirm_type": 0
}

Request a status of the transaction performed earlier

path Parameters
public_id
required
string
Example: f54ec96649be11ebb3780242ac130002

Merchant public ID

Request Body schema: application/json
required

Get the status of the performed transaction

merchant_id
required
string (merchantIdDef)

Unique Merchant ID received during the merchant registration

order_id
required
string (orderIdDef)

The unique value is generated by the transaction initiator for each Operation. Max length is 128 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “_” (underscore character), “-” (hyphen), “:” (colon), “.” (dot). For example, GUID or TIMESTAMP can be used as an order_id. This parameter provides API idempotency. It means that requests with identical nonce from the same transaction initiator will have identical responses and The corresponding operation won’t be repeated.

signature
required
string (signatureDef)

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found here

Responses

Request samples

Content type
application/json
{
  • "merchant_id": "e0fecd91fcb24f348048193b3fb34875ba3722b4",
  • "order_id": "16280954971628095497",
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Response samples

Content type
application/json
{
  • "order_id": "16280954971628095497",
  • "transaction_id": "732007046722",
  • "transaction_ref": "MP.33234.342.CP33",
  • "status": 2,
  • "result": {
    },
  • "provider_result": {
    },
  • "service_id": 1,
  • "service_version": 11.1,
  • "service_date_time": "2020-11-25 10:08:32.832969"
}

Get banks

path Parameters
public_id
required
string
Example: f54ec96649be11ebb3780242ac130002

Merchant public ID

Request Body schema: application/json
required

Get available banks

merchant_id
required
string (merchantIdDef)

Unique Merchant ID received during the merchant registration

provider_id
required
integer (providerDef)
Enum: 14 40

Provider ID. Can be one of the option from this list.

signature
required
string (signatureDef)

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found here

Responses

Request samples

Content type
application/json
{
  • "merchant_id": "e0fecd91fcb24f348048193b3fb34875ba3722b4",
  • "provider_id": 14,
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Response samples

Content type
application/json
{
  • "banks": [
    ],
  • "result": {
    }
}

POS Payments

Deposit via POS

Method should be called from the POS terminal or any other compatible external system for the initiation of the cash top-up operation to the customer account in the merchant system. Merchant gets information about the operation via the message that is sent to a predefined call back URL.

path Parameters
public_id
required
string
Example: f54ec96649be11ebb3780242ac130002

Merchant public ID

Request Body schema: application/json
required

Parameters to initiate a customer to the merchant payment

merchant_id
required
string (merchantIdDef)

Unique Merchant ID received during the merchant registration

customer_id
required
string (customerIdDef)

Customer ID (usually mobile phone number of the customer)

order_id
required
string (orderIdDef)

The unique value is generated by the transaction initiator for each Operation. Max length is 128 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “_” (underscore character), “-” (hyphen), “:” (colon), “.” (dot). For example, GUID or TIMESTAMP can be used as an order_id. This parameter provides API idempotency. It means that requests with identical nonce from the same transaction initiator will have identical responses and The corresponding operation won’t be repeated.

amount
required
string

Amount to pay, with two digits after point

currency
required
string (currencyDef)

Currency code in ISO 4217 format from the list of availabe currencies

country
string (countryDef)

Country code in ISO 3166-1 alpha-2 format as defined in the payment providers

extra
object

Extra parameters specific payment method

object

Extra parameters specific payment method, only for card providers like

provider_id
integer (providerIdPosDef)

ID of the payment provider. Can be 15 only

destination_id
string

Transaction destination ID

signature
required
string (signatureDef)

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found here

Responses

Callbacks

Request samples

Content type
application/json
{
  • "merchant_id": "e0fecd91fcb24f348048193b3fb34875ba3722b4",
  • "customer_id": "0900000001",
  • "order_id": "16280954971628095497",
  • "amount": "100.00",
  • "currency": "CDF",
  • "country": "KE",
  • "extra": { },
  • "card": {
    },
  • "provider_id": 15,
  • "destination_id": "2133456",
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Response samples

Content type
application/json
{
  • "order_id": "16280954971628095497",
  • "transaction_id": "732007046722",
  • "transaction_ref": "MP.33234.342.CP33",
  • "status": 2,
  • "result": {
    },
  • "provider_result": {
    },
  • "service_id": 1,
  • "service_version": 11.1,
  • "service_date_time": "2020-11-25 10:08:32.832969"
}

Callback payload samples

Callback
POST: Asynchronous notification of the merchant about the last performed transaction
Content type
application/json
{
  • "transaction_id": "1234567",
  • "order_id": "16280954971628095497",
  • "service_id": 12345,
  • "service_version": "5.2.0",
  • "service_date_time": "2020-11-25 10:08:32.832969",
  • "result": {
    },
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Withdrawal from the POS

Method should be called from the POS terminal or any other compatible external valid external system for the initiation of the cash pay-out operation from the customer account in the merchant system. Note, that such operation requires pre-authorization on the merchant system and it can be done in various ways. In some cases, it is just an OTP confirmation sent to a customer’s phone, but in other cases, pre-allocation of money is also required that shall be done by calling the payment_c2b operation from the customer’s space in the merchant system. In such case, the amount that the customer is willing to withdraw is moved to a temporary account that is hard-locked with this particular customer and will stay there until the method withdrawal is called.

If the confirm_type response parameter is a non-zero merchant, send the second withdrawal request with confirmation data according to the section Confirmation Types.

path Parameters
public_id
required
string
Example: f54ec96649be11ebb3780242ac130002

Merchant public ID

Request Body schema: application/json
required

Parameters to initiate the merchant to the customer payment

merchant_id
required
string (merchantIdDef)

Unique Merchant ID received during the merchant registration

customer_id
required
string (customerIdDef)

Customer ID (usually mobile phone number of the customer)

order_id
required
string (orderIdDef)

The unique value is generated by the transaction initiator for each Operation. Max length is 128 symbols. Allowed symbols: [a-z], [A-Z], [0-9], “_” (underscore character), “-” (hyphen), “:” (colon), “.” (dot). For example, GUID or TIMESTAMP can be used as an order_id. This parameter provides API idempotency. It means that requests with identical nonce from the same transaction initiator will have identical responses and The corresponding operation won’t be repeated.

amount
required
string

Amount to pay, with two digits after point

currency
required
string (currencyDef)

Currency code in ISO 4217 format from the list of availabe currencies

country
string (countryDef)

Country code in ISO 3166-1 alpha-2 format as defined in the payment providers

confirmation_code
string

Transaction confirmation code

extra
object

Extra parameters specific payment method

provider_id
integer (providerIdPosDef)

ID of the payment provider. Can be 15 only

destination_id
string

Transaction destination ID

signature
required
string (signatureDef)

Merchant’s request and callback have to be signed to verify sent data. To generate the signature all sent parameters are included in the order they were sent. The parameter signature should be excluded, of course. Example can be found here

Responses

Request samples

Content type
application/json
{
  • "merchant_id": "e0fecd91fcb24f348048193b3fb34875ba3722b4",
  • "customer_id": "0900000001",
  • "order_id": "16280954971628095497",
  • "amount": "100.00",
  • "currency": "CDF",
  • "country": "KE",
  • "confirmation_code": "654321",
  • "extra": { },
  • "provider_id": 15,
  • "destination_id": 2133456,
  • "signature": "d7d6d76b0e22c6f9d369fa6c24f107053d12bfd24d3b154f2deb6676bf179c123134e1f20879c803be455d81cfe792f00cd8892c26ce7cf5a05beebb9c80843e"
}

Response samples

Content type
application/json
{
  • "order_id": "16280954971628095497",
  • "transaction_id": "532007056722",
  • "transaction_ref": "",
  • "status": 2,
  • "result": {
    },
  • "provider_result": {
    },
  • "service_id": 11,
  • "service_version": 11.1,
  • "service_date_time": "2020-11-25 10:08:32.832969",
  • "confirm_type": 0
}