API Docs
Creating Wallets
When creating wallets, you need to specify the currency and country. This helps determine which withdrawal methods a developer/merchant can request for and can monitor payments in the currencies the customers would have paid with.
Headers
- Authorization:
Bearer YOUR_SECRET_KEY - Content-Type:
application/json
Body Parameters
currency
Required - Currency code (e.g., USD, ZWG, ZAR).
country
Required - Country code (e.g., ZW, ZA).
Response Parameters
result
Status of the wallet creation.
wallet_id
Wallet ID.
message
Message.
Sample Request to Create a Wallet
1. Wallet Creation Request
cURL
curl -X POST https://api.motapa.africa/v1/wallets \
-H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"country": "ZW"
}'Python
import requests
url = https://api.motapa.africa/v1/wallets
headers = {
"Authorization": "Bearer mp_test_26PHem9AhJZvU623DfE1x4sd",
"Content-Type": "application/json"
}
data = {
"currency": "USD",
"country": "ZW"
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Wallet created:", response.json())
else:
print("Error:", response.status_code, response.text)Sample Responses
Successful Wallet Creation (200)
{
"result": "success",
"wallet_id": "mp_wallet_1234567890",
"message": "Wallet created successfully."
}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."
}