STK Push

Once you/or business integrate with the RotsiAPI, you will be able to send a payment prompt on the customer's phone (STK Push Prompt) to your customer's M-PESA registered phone number

Making an STK push

Sim ToolKit.

POST https://api.rotsi.co.ke/payments/stkPush/v1

Make an STK Push Prompt to the Payer`s phone number.

Request Body

Name
Type
Description

username*

string

The username of the account, as per the Rotsi Dashboard.

amount*

Integer

The amount of the transaction

phone*

string

The phone number. USe the 254 format. Eg. 254722000000

const axios = require('axios');

const data = {
  amount: 1,
  phone: "254722000000",
  username: "username"
};

const config = {
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'secret_key'
  }
};

axios.post('https://api.rotsi.co.ke/payments/stkPush/v1', data, config)
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });
{
    "status": "Success",
    "Service": "RotsiSTK",
    "RotsiAPITransactionId": STK719hcbjh2,
    "CustomerMessage": "The payment is successful"
}                          

Last updated