Brij Mpesa Offline Integration
Authentication
To obtain a bearer token send the following fields to the token endpoint
Gets Auth token
POST
https://accounts.brij.africa/api/v1/connect/token
Use x-www-form-urlencoded body to obtain a bearer token
Request Body
client_secret*
String
<your-client-secret>
grant_type*
String
<your-client-credentials>
client_id*
String
<your-client-id>
Registering a Callback URL
To receive payment information once an offline payment is received, you need to register a callback URL along with the routing prefix that will have to be part of the account number the users will key in during payment.
For example, if the account number the user is paying to is 12862637, and your routing prefix is FT then the user has to enter FT12862637 as the account number when making the offline Mpesa Payment.
The routing prefix is important to prevent transaction mix-up. Your callback URL must accept post requests. The request body must be of type application/json.
Registering a Callback URL
POST
https://saf.brij.africa/api/mpesaoffline/register-url
Request Body
routingPrefix*
String
<your-prefix>
url*
String
<your-callback-url>
Updating the Callback URL
The API allows you to update the callback URL or prefix if need be.
Updating the Callback URL
POST
https://saf.brij.africa/api/mpesaoffline/update-url/
Query Parameters
id*
String
<your-url-id>
Request Body
routingPrefix*
String
<your-prefix>
Required if URL is null
otherwise optional
url*
String
<your-callback-url>
Required if routingPrefix is null otherwise optional
Mpesa Offline Callback Structure
Expect the following JSON payload in your registered callback URL.
Transaction Status Query
In case a callback is missed by our system or your system, the API provides a way to query the transaction status. You need to provide a result URL that will receive the transaction status callback once it is received from the Mpesa system
Querying transaction status
POST
https://saf.brij.africa/api/mpesaoffline/transaction-status
Request Body
billRefNumber*
String
<account-number>
transId*
String
<mpesa-transaction-id>
resultUrl*
String
<url-to-receive-result>
Transaction status callback structure (sent to resultUrl)
When the resultCode field has a value of 0 the paymentInfo object will be populated. Otherwise, check for possible failure in the message field.
Postman collection for the APIs is available at:
Last updated