Redde MPESA Gateway

Version: 1.0.0

The MPESA gateway is organized around REST. The API utilizes resource-oriented URLs, and uses HTTP response codes to indicate API errors. JSON is consumed and returned by all API responses, including errors. All requests should be sent to mpesagw.pestoe.com.

Default request content-types: application/json
Default response content-types: application/json
Schemes: https

Summary

Tag: request payment

Operation Description
POST /v1/stk/request

Request MPESA Payment

Tag: request payment status

Operation Description
POST /v1/stk/status

Request MPESA Payment status

Security

basicAuth

Type: basic
Description:

HTTP Basic Authentication using API ID and KEY

Paths

Request MPESA Payment

POST /v1/stk/request

Tags: request payment

This endpoint requests payment

Uses default content-types: application/json

Payee, MPESA details

Uses default content-types: application/json

200 OK

Payment status

default

Unexpected error

basicAuth
Request MPESA Payment status

POST /v1/stk/status

Tags: request payment status

This endpoint requests payment the status of a previously submitted request

Uses default content-types: application/json

3rd party reference id or gateway transaction id

Uses default content-types: application/json

200 OK

Payment status

default

Unexpected error

basicAuth

Schema definitions

GeneralResponse: object

status: string
statusCode: string
errors: string

MpesaPaymentResponse: object

status: string

the status of the request success is the default where ok

statusCode: string

the status code of the request 0 is successful.

transactionId: string

a unique transaction reference generated by the gateway

payReference: string

the original reference provided in the original

mpesaRefId: string

MPESA transaction reference, only present for a successful transaction

MpesaRequest: object

account: string

MPESA phone number in the format 07XXXXXXXXX.

amount: number

The amount payable

referenceId: string

A unique transaction reference number

userPromptReference: string

A transaction reference number for display (Service PIN Only) and is used as transaction description for STK

paybillNo: string

A paybill number to use for transaction

callback_url: string

a callback url to call when payment completed, will contain paymentConfirmed in query. With 5 as confirmed.

MpesaStatusRequest: object

referenceId: string

A transaction reference number