BuyGoods
This API enables you to pay for goods and services directly from your business account to a till number, merchant store number. You can also use this API to pay a merchant on behalf of a customer.
Creating a Buygoods Request.
For this to be successful, ensure that you have a minimum of 10 KSH in your account. Also ensure that the amount is equal or greater than 10 Kenyan Shillings.
Endpoint for the API request.
POST
https://api.rotsi.co.ke/payments/paybill/v1
Request Body
username*
string
The username of the account, as per the Rotsi Dashboard.
amount*
Integer
The amount of the transaction
phone*
string
The phone number the payment is being performed on behalf of. Use the 254 format. Eg. 254722000000
recipientSC*
String
The shortcode to which money will be moved
accountNumber*
String
The account Number of the paybill receiving the funds.
const axios = require('axios');
const data = {
amount: 10,
recipientSC: "000000",
accountNumber: "353353",
username: "username",
phone: "254722000000"
};
const config = {
headers: {
'Content-Type': 'application/json',
'Authorization': 'secret_key'
}
};
axios.post('https://api.rotsi.co.ke/payments/buygoods/v1', data, config)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
{
"status": "Success",
"Service": "RotsiBuygoods",
"RotsiAPITransactionId": BGP719hcbjh2,
"CustomerMessage": "The request is being processed"
}
Last updated