API Reference

Request for MPESA B2B Transfer

POST /trans/v2/applyForMpesaBusinessTransfer

<Use this endpoint to request for Mpesa B2B transfer>

Parameters

Parameters
Type
Description
Is Required

payerAccountId

string

The ID of the account that is to make the transfer

TRUE

payeeShortCode

string

The shortcode of the receiving paybill/till.

TRUE

payeeReferenceNumber

string

The account number that is required when receiving party is a Paybill.

FALSE

payType

string

0 - Paybill

1 - Till/BuyGoods

TRUE

amount

decimal

Transfer amount, it has to be whole number

TRUE

description

string

The message to beneficiary. Not more than 100 characters.

FALSE

payeeMobileForNotification

string

Specify beneficiary's mobile number here and the bank will send SMS notification to inform him/her about the inbound.

FALSE

Response

{
  "txId": "ONBOARD7695534567876"
}

Query Transaction List

POST /query/getTransList

<Use this endpoint to query transaction list>

Parameters

Parameters
Type
Description
Is Required

userId

string

User ID in BaaS partner's system, a unique string to indentify a certain end user.

TRUE

accountId

string

End user's account number

TRUE

txType

array of string

Transaction type filter.

FALSE

txStatus

array of string

Transaction status filter.

FALSE

startTime

long

Start time

TRUE

endTime

long

End time

TRUE

pageNo

int

Page number

TRUE

pageSize

int

Page size

TRUE

orderByDesc

int

0 - ASC

1 - DESC (default)

FALSE

Response

{
    "totalRows": "",
    "result": [
        {
            "txId": "",
            "txType": "",
            "accountId": "",
            "accountName": "",
            "accountType": "",
            "oppoAccountId": "",
            "oppoAccountName": "",
            "oppoBankName": "",
            "oppoBankCode": "",
            "thirdPartyTxType": "",
            "currency": "",
            "amount": "",
            "feeAmount": "",
            "txStatus": "",
            "createTime": "",
            "updateTime": "",
        }, {}      
    ]
}

Query Transaction Details

POST /query/getTransResult

<Use this endpoint to query the details of a transaction>

Parameters

Parameters
Type
Description
Is Required

txId

string

The ID of the transaction

TRUE

Response

{
  "txId": "",
  "txType": "",
  "accountId": "",
  "accountName": "",
  "accountType": "",
  "oppoAccountId": "",
  "oppoAccountName": "",
  "oppoSubAccount": "",
  "mpesBusinessPayType": "",
  "oppoBankName": "",
  "oppoBankCode": "",
  "thirdPartyTxType": "",
  "currency": "",
  "amount": "",
  "feeAmount": "",
  "extInfo": {
    "transactionNarrative": "",
    "oppoPhoneNumber": "",
  },
  "externalTxId": "",
  "paymentChannel": "",
  "originalTxId": "",
  "refundTxId": "",
  "txStatus": "",
  "createTime": "",
  "updateTime": "",
  "errorCode": "",
  "errorMsg": "",
}

Last updated