API Docs
Listing Transactions
You can list transactions using date range query parameters. The response will provide detailed information about the transactions.
Headers
- Authorization:
Bearer YOUR_SECRET_KEY - Content-Type:
application/json
Query Parameters
- start_date:
string(optional) - Start date for listing transactions (format: YYYY-MM-DD). - end_date:
string(optional) - End date for listing transactions (format: YYYY-MM-DD).
Sample Request to List Transactions
1. List Transactions using Date Range
cURL
curl -X GET "https://api.motapa.africa/v1/transactions/list?start_date=2023-01-01&end_date=2023-01-31" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/transactions/list"
params = {
"start_date": "2023-01-01",
"end_date": "2023-01-31"
}
headers = {
"Authorization": "Bearer mp_test_26PHem9AhJZvU623DfE1x4sd",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print("Transaction details:", response.json())
else:
print("Error:", response.status_code, response.text)2. List Last 100 Transactions
cURL
curl -X GET "https://api.motapa.africa/v1/transactions/list?limit=100" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/transactions/list"
params = {
"limit": 100
}
headers = {
"Authorization": "Bearer mp_test_26PHem9AhJZvU623DfE1x4sd",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print("Transaction details:", response.json())
else:
print("Error:", response.status_code, response.text)Sample Responses
Successful Listing (200)
{
"result": "success",
"transactions": [
{
"transaction_id": "mp_1234567890",
"transaction_reference": "MOTAPAPAY1234567890",
"amount": "1000",
"charges": "10",
"total": "1010",
"currency": "USD",
"payment_method_name": "Visa/Mastercard",
"payment_method_code": "card",
"payment_method_type": "card",
"message": "Transaction listed 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."
}