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 identify a certain end user.

TRUE

accountId

string

Account ID

TRUE

txType

array of string

Transaction type filter. Please refer to the transaction typearrow-up-right definition. If you want to get all type of the transaction record, just input blank array, i.e. []

TRUE

txStatus

array of integer

Transaction status filter. Please refer to the transaction statusarrow-up-right definition. Example: [2, 8] - Get all processing and succeed transaction records.

TRUE

startTime

long

UTC timestamp in millisecond of the start time of the queried period.

TRUE

endTime

long

UTC timestamp in millisecond of the end time of the queried period.

TRUE

pageNo

int

Assign the page number.

TRUE

pageSize

int

Assign how many records return.

TRUE

orderByDesc

int

Parameter to indicate how to sort the returns records. 1 - Sorting the records by transaction date in reversing order. 0 - Sorting the records by transaction date in positive order.

TRUE

Response

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

Last updated