📳POST: Send Customer MPESA STK
This endpoint enables you to send a customer an MPESA STK Push to receive payments to your linked payment channel
Integrate your MPESA Till Number, Paybill Number, or Bank Account seamlessly with Pay Hero to streamline automated payments and centralize payment tracking. Pay Hero offers a sophisticated API and aggregation service designed to enhance efficiency across diverse payment channels, positioning itself as the preferred solution for businesses and individuals seeking a comprehensive payment management system.
API Method
This endpoint enables you to initiate an MPESA STK Push request to get paid to your linked payment channel.
POST
https://backend.payhero.co.ke/api/v2/payments
Headers
Name | Type | Description |
---|---|---|
Authorization:* | String | Basic basicAuthToken |
Request Body
Name | Type | Description |
---|---|---|
amount* | Integer | Eg: 100 |
phone_number* | String | Eg: 0787677676 |
channel_id* | Integer | Your registered payment channel ID eg 133 Can be found by logging in, under the Account section, Payment channels. |
provider* | String | Value: m-pesa |
external_reference | String | Your unique reference to track this transaction Eg: INV-009 |
callback_url | String | Your endpoint URL that we will use to send payment status response eg: https://example.com/callback.php |
Sample Code
This represents PHP Curl example of how to make the request, you can implement this in your specific language of choice
Callback URL Response Sample
This represents the JSON that will be sent to your request callback_url, NOTE: it contains the ExternalReference that you provided in the request and CheckoutRequestID that was returned in the request response, you can use those to track and update your payments in your system/app
Last updated