Skip to main content

Payment Requests

Introduction

Payment requests allow users to initiate transactions by sending money to recipients using various payment networks. This documentation provides details on how to make payment requests via HTTP POST requests and includes code examples in different programming languages.

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/v2/payments

Authorization

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

AUTHORIZATION: Basic Auth

Username <username>
Password <password>

Request Body (Token Object)

The request body should include the necessary parameters for the transaction, such as the username, network code, amount, recipient's phone number, narration, currency, and callback URL.

json
{
"username": "johndoee",
"network_code": "57",
"amount": 100,
"phone_number": "0712345678",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://example.com/callback"
}

Code Examples

Below are code examples in different programming languages demonstrating how to send money to a mobile number using HTTP POST requests.

curl --location -g 'https://api.mypayd.app/api/v2/payments' \
--data '{
"username": "johndoee",
"network_code": "57",
"amount": 100,
"phone_number": "0712345678",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://example.com/callback"
}
'

Conclusion

Payment requests offer a seamless way for users to initiate transactions and send money securely to recipients through various payment networks. By following the instructions outlined in this documentation, users can easily integrate payment request functionality into their applications or services.