Skip to main content

Mobile Payments Requests

Introduction

The Mobile Payments API allows you to receive funds directly to a recipient's mobile wallet (e.g., M-PESA) through a single, unified endpoint.

Making Payment Requests

To make payment requests, users need to send an HTTP POST request to the specified endpoint with the required parameters.

Endpoint

https:api.mypayd.app//api/v3/payments

Authorization

Users need to include basic authentication credentials in the request headers.

Authorization: Basic <base64-encoded-username:password>
Content-Type: application/json
X-Payd-Merchant-ID: <your_merchant_id>

Request Body

This payload allows you to make mobile payments using the Payd API. The request body must include the following structure:

json
{
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "momo",
"account_number": "+254712434671",
"amount": 50,
"phone_number": "07712345671",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile"
}

Below are code examples in different programming languages demonstrating how to make card payments using HTTP POST requests.

curl --location 'https:api.mypayd.app//api/v3/payments' \
--data-raw '{
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "momo",
"account_number": "+254712434671",
"amount": 50,
"phone_number": "07712345671",
"channel_id": "7c7833d8-2f26-430e-8675-7ff07a5caf0c",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile"
}`

Example of a successful response

{
"status": "SUCCESS",
"transaction_reference": "VGC124302386eR",
"success": true,
"message": "Processed successfully",
"trackingId": "",
"reference": "",
"result": null
}

Conclusion

The Mobile Payments endpoint enables seamless and secure transactions through mobile channels such as M-PESA by using the unified v3/payments endpoint, all mobile payment flows—across providers and currencies—can be handled with a single API call.