I have been looking at Kopokopo API and the problems many people are facing trying to Integrate the Till Number payments to their websites or mobile apps and today I have decided to chip in to help a few guys here. First of all, Kopokopo gives Till Numbers to individuals and Businesses so that you can get paid in large and small amounts without the necessity of giving our your personal numbers.
Without Kopokopo API integration, you can receive payments to your Till number. However, your website goods and services will not be processed automatically. This gives a lot of headache trying to reconcile payments to their payers and orders.
Kopokopo Mpesa api Integration will ease this for you.
Let me dive in and take you through Kopokopo API integration:
Please note that I do offer Kokokopo Mpesa api Integration if this guide seems complicated for you. So do not worry. Just call me or whatsapp me on: +254706745202
Requirements to Integrate Kopokopo Mpesa API
1. A buygoods Till number registered through Kopokopo.
2. An account from Kopokopo on the website https://app.kopokopo.com
Common misconceptions about Kopokopo Mpesa API addressed below:
- Kopokopo has nothing to do with Daraja API. If you apply a Till number from Kopokopo guys, do not dream of getting the Mpesa portal username and password that will allow you Integrate with Daraja and enjoy the versed features that Daraja offers.
- Kopokopo Till numbers cannot help you get an stk push functionality.
- Kopokopo Till numbers have no account part. So if you are thinking about getting a paybill for the account number part, contact safaricom directly.
So now that you have a KopoKopo Till numbers, below is the integration process:
1. The first is to login your kopokopo account and click API settings.
2. Enter your Transaction push API * settings and save.
Note: Your Kopokopo API version should be V3, Notification URL shoud a url that you can edit and have control over and should be hosted (preferrably accessible via https), username and password are optional.
3. Note your API Key and you can regenerate a new one.
Fig 1: An illustration of the Kopokopo Push API settings. These are essentially what you need to setup so that you start receiving Push notification to your server via the provided endpoint anytime someone pays you via your Buygoods till acquired through Kopokopo. Essentially this Till number if from Safaricom Mpesa, but Kopokopo are like third-part techie company providing easy integration services and application of Buy goods till numbers.
From this point, you are 1/3 done with the Kopokopo API integration.
Capturing and reading the data from Kopokopo API anytime a client pays to your Till.
In your endpoint that you entered as Notification url above, write in your best backend language a way to capture the data sent to that url. They are sending json data to that file.
Below is an example in php:
Then result of the above is the json data for each transaction.
The next step is to consume that data depending on your business logic. This is where your programming skills come in. Do that thing using code that you wanted to do anytime a client successfully makes the payment.
The last step is to display to the clients the steps to make payment to your Till that you got from Kopokopo.
That is all. As easy as that.