Skip to main content

Card Payments Request

Introduction

The Card Payments feature allows you to send money securely using debit or credit cards through our unified API. This documentation explains how to make card payments using an HTTP POST request and provides working examples in several programming languages.

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 securely collect card-based payments using the Payd API. The request body must include the following structure:

json

{
"username": "amazing",
"email": "paydconsultants@gmail.com",
"amount": 101,
"phone_number": "0712345678",
"first_name": "amazing",
"last_name": "maverick",
"narration": "Payment for goods",
"currency": "KES",
"redirect_url": "https://payd-test.free.beeceptor.com",
"channel": "card",
"provider": "instasend"
}

Code Examples

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": "amazing",
"email": "paydconsultants@gmail.com",
"amount": 101,
"phone_number": "0712432771",
"first_name": "amazing",
"last_name": "maverick",
"narration": "Payment for goods",
"currency": "KES",
"redirect_url": "https://payd-test.free.beeceptor.com",
"channel": "card",
"provider": "instasend"
}'

Example of a successful response

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

Conclusion

The card payments feature provides a convenient way for users to send money securely using their debit or credit cards. By following the instructions outlined in this documentation, users can easily integrate card payments into their applications or services.