NAV
JSON

Introduction

Welcome to the Merchant Payment Platform API reference.

This API serves as the primary gateway to facilitate payments through Merchant Payment Platform

If this is your first time using our APIs, please check out our Getting Started guide. If you already have your API credentials, our Search and Response Formats can help you refine your results.

The Merchant Payment Platform is organized according to REST principles and provides the following functionalities:

Environment

This API is available in 2 environments: production and sandbox, reachable via HTTPS.

Versioning

Endpoints of the API are prefixed with a corresponding version number. This documentation describes version 1 of the API.

This method of versioning provides complete isolation between implementations and ensures that subsequent major changes to the API will not affect existing integrations. No breaking changes will be introduced within a major version.

Our API is constantly being updated with new features and improvements to existing ones. These updates ensure the API evolves with customer and industry demands. Managing this change to ensure we provide a reliable, consistent, and backward compatible API design is a critical challenge for our team. Every new and improved feature is put through a peer review process to ensure:

it will not change an existing resource to the extent it breaks current customer implementations, that it is consistent with existing resources (therefore predictable and easy to use).

The following guidelines are used in our peer review process to understand what constitutes acceptable change for our API and our customers.

Changes we avoid:

If, for any reason, we cannot avoid any of the non-backward compatible changes mentioned above, we will implement a deprecation schedule. This schedule will be provided to all customers with the goal of giving them adequate time to accommodate the updates.

Looking further out, as our API evolves and industry standards dictate, we do anticipate the possibility that an entirely new API version will be needed. If and when that happens we will, once again, provide a deprecation schedule for the existing version that will ensure all customers have time to upgrade.

Security

MERCHANT PAYMENT PLATFORM API uses the Resource Owner Password Credentials Grant flow of OAuth 2.0 for authentication and allows applications to submit authenticated requests on behalf of individual merchant platform users.

An authorization header containing a valid access token must be included in every MPP API request like follows:

Authorization: Bearer YOUR_ACCESS_TOKEN

Sample of request with authorization token:

GET /api/v1/business/ HTTP/1.1
Content-Type: application/json
Authorization: Bearer "YOUR ACCESS TOKEN"

Additional information:

Undocumented resources and properties are considered to be in beta release and are subject to change without notification.

Response / Request

The response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

Each API request has an associated request identifier. You can find this value in the response body, under trace_request_id.

To expedite the resolution process, provide the request identifier when you contact us about a specific request.

Some general information about responses:

{
    "data": [],
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "49d16cdc-a947-4311-93b5-0b3fd95f46b6",
    "success": true
}

All response contains these fields:

Field Description
success if true the request has been successfully executed, if not it means that the request has failed.
code response code
message description of the re
trace_request_id api request identifier

Pagination

{
    "current_page": 1,
    "data": [],
    "first_page_url": "{{base_url}}/api/v1/business/all?page=1",
    "from": null,
    "last_page": 1,
    "last_page_url": "{{base_url}}/api/v1/business/all?page=1",
    "next_page_url": null,
    "path": "{{base_url}}/api/v1/business/all",
    "per_page": 15,
    "prev_page_url": null,
    "to": null,
    "total": 0,
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "49d16cdc-a947-4311-93b5-0b3fd95f46b6",
    "success": true
}

Many of our APIs have the potential to return lots of results. To make these large responses more manageable, we break them into pages. By default, we include 15 results per page, but you can ask for up to 100 per page by making use of the page_size parameter. Use the page parameter to choose which page of results you’d like returned.

Input Parameters

Field Required Type Description
page No Integer Page number
page_size No Integer Number of results per page (default 15, maximum 100)

Here is an explanation of the meta data when more than one page is available:

Field Description
current_page the page being returned
from the index of the first item returned on the current page
to the index of the last item returned on the current page
per_page the number of results returned per page
total the total number of items returned by the query
first_page_url api url to return results of the first page
last_page_url api url to return results of the last page
next_page_url api url to return results of the next page
prev_page_url api url to return results of the previous page

Errors

HTTP Response

Code Title Description
200 OK Successful request.
201 Created The resource was successfully created.
202 Async created The resource was asynchronously created
400 Bad Request Returns JSON with the error message.
401 Unauthorized Your API key is wrong or expired.
403 Forbidden User hasn't authorized necessary scope.
404 Not Found The resource does not exist.
405 Method Not Allowed You tried to access api with an invalid method.
409 Conflict The requested operation on the resource cannot be made due the resource state
422 Validation error Returns JSON with the error message.
429 Too Many Requests The rate limit was exceeded.
500 Internal Server Error We had a problem with our server. Try again later.
503 Service Unavailable Your connection is being throttled or the service is down for maintenance.

API Error codes

Code Description
MPP-REQ-0000 Successful request.
MPP-REQ-4000 Request failed.
MPP-REQ-4002 Validation code/otp is not valid or has expired.
MPP-REQ-4005 Method not allowed.
MPP-REQ-4004 Resouce not found.
MPP-REQ-4008 Object/resource not found.
MPP-REQ-4022 Bad parameters.
MPP-ACC-1001 Username already exists
MPP-AUTH-4401 Unauthorized
MPP-AUTH-4402 Username or password incorrect
MPP-AUTH-4403 Email not verified
MPP-AUTH-4404 Your email has been already verified
MPP-AUTH-4405 Invalid password
MPP-AUTH-4406 Incorrect credentials with Two-Factor Authentication
MPP-AUTH-4407 Not authorized to perform that action
MPP-BS-4504 Business not created yet
MPP-BS-4505 Business not found
MPP-BS-4506 Account already linked to a business
MPP-BS-4507 Business account not actived
MPP-TX-4301 The transaction cannot be cancelled
MPP-TX-REQ-4091 Conflict over the treatment of resources
MPP-PP-4200 Payment page not fully configured

Getting started

Generate api key

Before you can start using our APIs, you need an API key. It’s easy.
Just visit Merchant Platform and sign up with your email address. Verify your email, then sign in, create your business and select Account settings menu then click on Apis keys Tab. There you can generate your Api key.
Once you’ve activated your key, you’re ready to roll

Keep these keys confidential, as it can be misused if shared or stolen. Exposed API keys can lead to serious security risks, such as unauthorized access to sensitive data, system functionalities, and proprietary business information.

Note that you can revoke or regenerate new API KEYS, the old one will automatically become useless.

Merchant Payment Platform API allows to operate globally accross different payout and payment ecosystems, Mobile Wallet, Bank Account, Card payment.

To initiate a transaction, the typical flow would be:

Business channels endpoints allow Merchant Payment Platform partner to retrive list of the channel they are subscribed to. The channel in Merchant Payment Platform system represents the targeted destination crediting/debitted the money into the beneficiary account. Merchant Platform coverage supports different channel across all services (banks, mobile wallets or Card payment) per country.

As part of the channel information, an API user can dynamically retrieve requirement and information linked to the selected channel, like required fields, allowed categories for the specific business.

This ID is needed to initiate/create a transaction.

To check the status of the transaction, a partner can provide a callback url. Merchant Payment Platform system will send a callback to this url when the transaction status is updated from transamitted to any other status. A partner is also able to query the status of a transaction in the API, to check its current status.

Transaction states

Transaction status flow

During the course of the operation, a transaction will undergo various status changes.

If a callback URL has been provided, updates will be sent to the URL in real-time when changes in transaction status occur. In addition, transaction status can be queried through the returned id.

Callback

While the transaction is processed, changes in status will be notified in realtime to the provided callback URL (if provided).

The sending partner must implement this endpoint to receive these status changes. The endpoint should expect an HTTP POST request containing a transaction object represented in JSON.

Upon sucessful receipt of data, the callback endpoint should respond with an HTTP 2XX. In the event that your platform did not receive this response, callback notifications will be retried several times, beyond which, the transaction status will have to be queried via API check transaction status.

The callback url must be implemented b

Authentication

All APIs require you to authenticate yourself using your a bearer token to authenticate. If authentication fails, server may return status codes 401, 403, 422 or 404.

Your API keys and secrets represent your identity and authorization. Please keep and store them securely!

API credentials should not be shared or stored in clear text. Once in your possession, it is on you to keep those credentials safe.

Generate Access Token

Generates the OAuth2 token.

GET /auth/token

Request Body

Parameter Description
secret_id Secret id.
secret_key Secret key .
POST /api/auth/token HTTP/1.1
Content-Type: application/json

{
  "secret_id":"YOUR SECRET ID",
  "secret_key":"YOUR SECRET KEY"
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "access_token": "your token",
        "expires_in": 1740,
        "refresh_expires_in": 1800,
        "refresh_token": "you refresh token",
        "token_type": "Bearer",
        "not-before-policy": 0,
        "session_state": "",
        "scope": ""
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "success": true,
    "trace_request_id": "48881383-9dd1-4979-98dd-44d9f62008ea"
}

Business

Get business info

GET /api/v1/business HTTP/1.1
Content-Type: application/json

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": "9ad49c94-6983-477b-ad48-20b33ea66bbf",
        "name": "BNB-MPP-SL",
        "is_phone_verified": 0,
        "address": "SL",
        "code": "521395",
        "can_accept_cash_deposit": false,
        "commission": 0,
        "verified": false,
        "currency": {
            "id": 4,
            "iso3": "SLE"
        },
        "country": {
            "id": 4,
            "iso2": "SL"
        },
        "limit_overdraft": 0,
        "overdraft": false,
        "user_info": {
            "email": "bnb-sl@cauridor.com",
            "phone": null,
            "is_phone_verified": false,
            "name": "sl debug-sl",
            "is_api": false,
            "has_2fa": false,
            "owner": true,
            "roles": [
                "merchant"
            ]
        }
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "a85fcdb2147cf96597053cf178e2cc1f",
    "success": true
}

Retrieve information about your business account.

HTTP Request

GET /api/v1/business

Response

Field Type Description
id Uuid Unique id identifier of the business
name String Label, name of the business
phone String Public mobile number in E.164 format
address String Address
code String Unique code of 6 digits.
can_accept_cash_deposit Boolean Cash deposit
verified Boolean Determine if the business provides valid administrative document
currency Object currency
country Object Country
overdraft Boolean Determine if the overdraft is activated
limit_overdraft Number Allowed overdraft
user_info Object logged in user information

Balances

GET /api/v1/business/{BUSINESS_ID}/balance

GET /api/v1/business/9ad49c94-6983-477b-ad48-20b33ea66bbf/balance HTTP/1.1
Content-Type: application/json

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "balance": 10282,
        "commission": 0,
        "currencry": "SLE"
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "bc94cb440504de6a0e6940f8937b526d",
    "success": true
}

Retrieve information for all account balances for {BUSINESS_ID} provided. Business ID can be retrieved from Get business info api.

HTTP Request

GET /api/v1/business/{BUSINESS_ID}/balance

Response

Field Type Description
balance Number Available balance
commission Number Earned commission
currencry String Currency in ISO_4217 format

Channels

GET /api/v1/business/{BUSINESS_ID}/channel HTTP/1.1
Content-Type: application/json

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "current_page": 1,
    "data": [
        {
            "id": 97,
            "status": "active",
            "code": "OM",
            "description": "Orange Money",
            "fields": {
                "msisdn": [
                    "required",
                    "string"
                ],
                "amount": [
                    "required",
                    "numeric"
                ],
                "email": [
                    "nullable",
                    "email"
                ],
                "phone": [
                    "nullable",
                    "string",
                    "phone_number"
                ],
                "first_name": [
                    "nullable",
                    "string"
                ],
                "last_name": [
                    "nullable",
                    "string"
                ],
                "account_number": [
                    "nullable",
                    "string"
                ]
            },
            "active": true,
            "callback": null,
            "categories": [
                {
                    "id": 133,
                    "transaction_category": "payment",
                    "fee_payer": "merchant"
                },
                {
                    "id": 134,
                    "transaction_category": "transfer",
                    "fee_payer": "merchant"
                }
            ]
        }
    ],
    "first_page_url": "{base_url}/api/v1/business/9b43c8d9-1353-45d7-a0ab-6427227940dc/channel?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "{base_url}/api/v1/business/9b43c8d9-1353-45d7-a0ab-6427227940dc/channel?page=1",
    "next_page_url": null,
    "path": "{base_url}/api/v1/business/9b43c8d9-1353-45d7-a0ab-6427227940dc/channel",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 1,
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "603d5636d1e97b5f1de8a0ffebf52e0d",
    "success": true
}

Retrieve the list of channels to which a business has subscribed. Business ID can be retrieved from Get business info api.

HTTP Request

GET /api/v1/business/{BUSINESS_ID}/channel

Response

returns a list of channel object

Validate account and retrieve information

GET /api/v1/channel/account/validate HTTP/1.1
Content-Type: application/json

{
    "code": "om",
    "msisdn": "+22394996021"
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "first_name": "Abdou",
        "last_name": "Diogue",
        "birth_date": "1976-08-13",
        "gender": "MALE"
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "traceRequestId": "b97edb50-ccc1-4593-a97f-4db1aabc03b4",
    "success": true
}

Validate wallet account and retrieve wallet owner information

HTTP Request

/api/v1/channel/account/validate

Field Required Type Description
code Yes String Channel code
msisdn Yes String

Response

Field Type Description
first_name String First name
last_name String Last name
birth_date String Birth date, format Y-m-d
gender String The gender

Transaction

Create transaction

POST /api/v1/transaction HTTP/1.1
Content-Required | : application/json

{
    "business_id":"9b43c8d9-1353-45d7-a0ab-6427227940dc",
    "channel": "CDT",
    "external_id": "fe9a14fc-0ca1-4cf7-887f-09e22d1c5ae5",
    "currency": "GNF",
    "category": "transfer", 
    "amount": 2,
    "msisdn": "080002209",
    "account_number": "TAX_01_1234",
    "first_name": "bockarie",
    "last_name": "Marah",
}

Response:

HTTP/1.1 200 OK
Content-Required | : application/json

{
    "data": {
        "id": "9b60b6c4-bdd0-43e7-a529-520845a16281",
        "status": "initiated"
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "59d4057b-85d3-4b91-8278-ffa3a40abf93",
    "success": true
}

This endpoint used to initiate a transaction. The request body strongly depend on the channel used to process the transaction, there are some basic fields required and the others are the fields of the channel selected.

You need to retrieve the channel detail data to know which fields are required.

HTTP Request

POST /api/v1/transaction

Field Required Type Description
business_id Yes Uuid Business Id
channel Yes String channel code
external_id Yes String Unique id that identify the transaction in your platform
currency Yes String Allowed business currency in ISO_4217 format
category Yes String Transaction category
msisdn Yes String Local format phone number (om channel field)
account_number No String test (om channel field)

Response

Field Type Description
id Uuid transaction id
status String transaction status

At this stage, to find out what is the status of the transaction, you can call the api Get transaction status or Transaction detail.

Transaction details

GET /api/v1/transaction/9b60b6c4-bdd0-43e7-a529-520845a16281 HTTP/1.1
Content-Required | : application/json

Response:

HTTP/1.1 200 OK
Content-Required | : application/json

{
    "data": {
        "id": "9b60b6c4-bdd0-43e7-a529-520845a16281",
        "id2": "AezuytQW",
        "reference": "766151",
        "originated": null,
        "category": "transfer",
        "accounting_type": "authorize",
        "external_id": "fd000b95-7dda-4a00-bacb-6faec38cd922",
        "author": {
            "name": "beny marel Pambou"
        },
        "verified_by": null,
        "amount": 2,
        "fees": 0,
        "merchant_commission": 0,
        "fee_payer": "merchant",
        "total_amount": 2,
        "before_balance": 76738.84,
        "after_balance": 76736.84,
        "end_at": "2024-02-20T02:40:59.000000Z",
        "message": "transfer/transaction completed",
        "reason": null,
        "direction": "debit",
        "status": "completed",
        "created_at": "2024-02-20T02:40:55.000000Z",
        "updated_at": "2024-02-20T02:40:59.000000Z",
        "payment_page_id": null,
        "payment_request_id": null,
        "details": {
            "phone": "+224624849557",
            "account_number": "TAX_01_1234",
            "first_name": "bockarie",
            "last_name": "Marah",
            "receiver_merchant_code": "232857"
        },
        "customer_profile": null,
        "channel": {
            "code": "CDT",
            "type": "cash",
            "description": "Cash deposit"
        },
        "business": {
            "id": "9a68577c-1c58-4dd0-9b0e-2596191c0649",
            "name": "HelloBusiness1",
            "address": "Batiment sud est",
            "code": "697224",
            "can_accept_cash_deposit": true,
            "status": "active",
            "onboarding_status": "request-add-channel",
            "created_at": "2023-10-19T15:29:10.000000Z",
            "verified": false
        },
        "sender_business": {
            "id": "9a68577c-1c58-4dd0-9b0e-2596191c0649",
            "name": "HelloBusiness1",
            "address": "Batiment sud est",
            "code": "697224",
            "can_accept_cash_deposit": true,
            "status": "active",
            "onboarding_status": "request-add-channel",
            "created_at": "2023-10-19T15:29:10.000000Z",
            "verified": false
        },
        "receiver_business": null,
        "currency": {
            "id": 1,
            "iso3": "GNF"
        },
        "country": {
            "id": 1,
            "iso2": "GN"
        }
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "b26f154f-9f36-4bb7-9945-0d70689d6a67",
    "success": true
}

Retrieve transaction details.

HTTP Request

GET /api/v1/transaction{TRANSACTION_ID}

Field Required Type Description
business_id Yes Uuid Business Id
channel Yes String channel code
external_id Yes String Unique id that identify the transaction in your platform
currency Yes String Allowed business currency in ISO_4217 format
category Yes String Transaction category
msisdn Yes String Local format phone number (CDT channel field)
account_number No String Account number/customer account id (CDT channel field)
first_name Yes String first name (CDT channel field)
last_name Yes String last name (CDT channel field)

Response

return transaction object.

Get transaction status

GET http://localhost/api/v1/transaction/9b60b6c4-bdd0-43e7-a529-520845a16281/get-status HTTP/1.1
Content-Required | : application/json

Response:

HTTP/1.1 200 OK
Content-Required | : application/json

{
    "data": {
        "id": "9b60b6c4-bdd0-43e7-a529-520845a16281",
        "reference": "766151",
        "status": "completed"
    },
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "cedcab08-00ae-4ed9-8b71-e9e2abc0747a",
    "success": true
}

Retrieve the status for {TRANSACTION_ID} provided.

HTTP Request

GET http://localhost/api/v1/transaction/{TRANSACTION_ID}/get-status

Response

Field Type Description
id Uuid transaction id
reference String unique reference of the transaction
status String transaction status

List transactions

GET http://localhost/api/v1/transaction/ HTTP/1.1
Content-Required | : application/json

Response:

HTTP/1.1 200 OK
Content-Required | : application/json

{
    "current_page": 1,
    "data": [
        {
            "id": "9b597d26-634d-4dcc-a4d3-95e3d3c7650b",
            "id2": "gawCvD4Y",
            "reference": "157783",
            "originated": null,
            "category": "transfer",
            "accounting_type": "authorize",
            "external_id": "59b84e55-2119-44ec-92de-51264f80eb5c",
            "verified_by": null,
            "amount": 4,
            "fees": 0,
            "fee_payer": "end_user",
            "total_amount": 4,
            "before_balance": 10282,
            "after_balance": 10278,
            "end_at": "2024-02-16T12:29:22.000000Z",
            "message": "transfer failed",
            "reason": "Error occurred. Please try again later",
            "direction": "debit",
            "exhange_rate": null,
            "status": "failed",
            "created_at": "2024-02-16T12:29:00.000000Z",
            "updated_at": "2024-02-16T12:29:22.000000Z",
            "payment_page_id": null,
            "payment_request_id": null,
            "details": {
                "msisdn": "080002209",
                "route": "USSD",
                "phone": "+224624849557",
                "first_name": "bockarie",
                "last_name": "Marah",
                "account_number": "TAX_01_1234"
            },
            "currency": {
                "id": 4,
                "iso3": "SLE"
            },
            "country": {
                "id": 4,
                "iso2": "SL"
            },
            "channel": {
                "code": "AFM",
                "type": "momo",
                "description": "AfriMoney"
            }
        }
    ],
    "first_page_url": "http://gateway.mpp.bnbcash.app/api/v1/transaction?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://gateway.mpp.bnbcash.app/api/v1/transaction?page=1",
    "next_page_url": "http://gateway.mpp.bnbcash.app/api/v1/transaction?page=1",
    "path": "http://gateway.mpp.bnbcash.app/api/v1/transaction",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 1,
    "code": "MPP-REQ-0000",
    "message": "ok",
    "trace_request_id": "e518c892a365665faf1515afdb1c1a3d",
    "success": true
}

Retrieve List of transactions.

HTTP Request

GET http://localhost/api/v1/transaction/

Response

return List of transactions.

Enumerations

Fee Payer

Value Description
merchant merchant pay fees
end_user customer pay the fees, debitted amount = transaction amount + fees

Field Properties

Value Description
required required field
nullable not required field
string the value must be a string
numeric the value must be a number
email the value must an email
min:x minimum number/size accepted is x
max:x maxmimum number/size accepted is x
mimes:jpg,png,jpeg,pdf file type field that accepts only jpg, png and pdf

Transaction category

Value Description
payment Customer pays a merchant for a service or product. This is a collection
transfer Credit customer account depending on the channel. The merchant will be debitted.
payout Merchant pull out the money from Merchant Platform to a specific account provided
cashin Merchant credited another merchant account of the platform by receiving the amount in cash
deposit Merchant request a credit of his balance by providing a proof of evidence
topup Merchant credit another merchant account of the platform. Account to Account operation

Transaction status

Value Description
initiated Transaction has been created.
pending The process of the transaction has been started.
processing Transaction in process
transmitted The request has been successfully sent to the partner
completed The transaction is completed and fund has been credited or debitted.
failed Transaction request failed
rejected Partner or merchant platform reject the transaction
cancelled Transaction cancelled before being transmitted to partner
blocked For reasons of non-compliance, transaction blocked and in review
refunded The fund of the transaction is reversed to the merchant account.

Resources

Channel

Represents channel information.

Field Type Description
id Integer Business channel id
status String [Business status Channel]
code String Unique code for channel
active Boolean Determine if the channel is active for the business
description String Explaination
fields Object Available/requireds fields for the channel
categories Object list of categories that can be used

Channel fields

Represent properties of the field. The key is the name of the field and the value contains the properties of that field, the type, is it required? etc..

Sample : "amount": ["required","numeric", "min:1"]

For that field above, the input name is amount, the value must be a number and the minimum is 1.

Consult field proporties index

Channel Category

Field Type Description
id Integer Business channel id
transaction_category String Transaction category
fee_payer String who pays the fee Transaction category

Country

Represents country information.

Field Type Description
id Integer Country ID
iso2 Country in ISO_3166-1_alpha-2 format

Currency

Represents country information.

Field Type Description
id Integer Country ID
iso3 String Currency in ISO_4217 format

User

Represents user information.

Field Type Description
email String User's email.
phone String phone
is_phone_verified Boolean Is phone number is verified
name String name
is_api Boolean api user?
has_2fa Boolean Is two factor authentication activated?
owner Boolean Is this user the owner of the business
roles Array Roles of the user