API Docs
Fetching Payment Links
You can fetch a payment link using the payment link ID. The response will provide detailed information about the payment link.
Headers
- Authorization:
Bearer YOUR_SECRET_KEY - Content-Type:
application/json
Query Parameters
- payment_link_id:
string(optional) - Payment Link ID.
Sample Request to Fetch a Payment Link
1. Fetch Payment Link using Payment Link ID
cURL
curl -X GET "https://api.motapa.africa/v1/links/fetch?payment_link_id=mp_link_1234567890" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/links/fetch"
params = {
"payment_link_id": "mp_link_1234567890"
}
headers = {
"Authorization": "Bearer mp_test_26PHem9AhJZvU623DfE1x4sd",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print("Payment link details:", response.json())
else:
print("Error:", response.status_code, response.text)Sample Responses
Successful Retrieval (200)
{
"result": "success",
"payment_link": {
"payment_link_id": "mp_link_1234567890",
"amount": "100.00",
"currency": "USD",
"message": "Payment link fetched successfully.",
"details": {}
}
}Bad Request (400)
{
"result": "error",
"message": "Invalid request parameters."
}Unauthorized (401)
{
"result": "error",
"message": "Unauthorized. Please provide a valid API key."
}Internal Server Error (500)
{
"result": "error",
"message": "Internal server error. Please try again later."
}