Skip to main content

Withdrawal Requests

Introduction

The withdrawal requests feature allows users to withdraw money from their accounts using our platform's API. This documentation provides details on how to initiate withdrawal requests via HTTP POST requests and includes code examples in various programming languages.

Making Withdrawal Requests

To initiate a withdrawal request, users need to make an HTTP POST request to the specified endpoint with the required parameters.

Endpoint

https://api.mypayd.app/api/v2/withdrawal

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 withdrawal request, such as the account ID, recipient's phone number, withdrawal amount, narration, callback URL, and channel.

json
{
"account_id": "4c0f6ad5-92bf-4fd1-ba93-8c89c9d23616",
"phone_number": "+254718686209",
"amount": 100,
"narration": "Withdrawal request",
"callback_url": "https://example.com/callback",
"channel": "63902"
}


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 'https://api.mypayd.app/api/v2/withdrawal' \
--data '{
"account_id": "4c0f6ad5-92bf-4fd1-ba93-8c89c9d23616",
"phone_number": "+254718686209",
"amount": 100,
"narration": "Withdrawal request",
"callback_url": "https://example.com/callback",
"channel": "63902"
}
'

Example of a successful response

{
"success": true,
"correlator_id": "12345abcd",
"message": "Payout processed successfully",
"status": "completed"
}

Conclusion

The withdrawal requests feature provides a convenient way for users to withdraw funds from their accounts securely. By following the instructions outlined in this documentation, users can easily integrate withdrawal requests into their applications or services.