API Docs
Verifying Transactions
You can verify transactions using a transaction reference, a transaction ID, or a checkout ID. The response will provide detailed information about the transaction status and other relevant details.
Headers
- Authorization:
Bearer YOUR_SECRET_KEY - Content-Type:
application/json
Query Parameters
- transaction_reference:
string(optional) - Transaction reference provided by merchant/developer. - transaction_id:
string(optional) - Transaction ID. - checkout_id:
string(optional) - Checkout ID.
Sample Request to Verify a Transaction
1. Verify Transaction using Transaction Reference
cURL
curl -X GET "https://api.motapa.africa/v1/transactions/verify?transaction_reference=MOTAPAPAY1234567890" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/transactions/verify"
params = {
"transaction_reference": "MOTAPAPAY1234567890"
}
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. Verify Transaction using Transaction ID
cURL
curl -X GET "https://api.motapa.africa/v1/transactions/verify?transaction_id=mp_1234567890" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/transactions/verify"
params = {
"transaction_id": "mp_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("Transaction details:", response.json())
else:
print("Error:", response.status_code, response.text)3. Verify Transaction using Checkout ID
cURL
curl -X GET "https://api.motapa.africa/v1/transactions/verify?checkout_id=mp_chk_1234567890" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/transactions/verify"
params = {
"checkout_id": "mp_chk_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("Transaction details:", response.json())
else:
print("Error:", response.status_code, response.text)4. Verify Transaction using Mobile Money (Innbucks)
cURL
curl -X GET "https://api.motapa.africa/v1/transactions/verify?transaction_reference=MOTAPAPAY1234567890&code=123456&requested_response=success" \ -H "Authorization: Bearer mp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json"
Python
import requests
url = "https://api.motapa.africa/v1/transactions/verify"
headers = {
"Authorization": "Bearer mp_test_26PHem9AhJZvU623DfE1x4sd",
"Content-Type": "application/json"
}
params = {
"transaction_reference": "MOTAPAPAY1234567890",
"code": "123456",
"requested_response": "success" # Set to "success" or "failed" to simulate the desired response
}
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 Verification using Transaction Reference (Card) (200)
{
"result": "success",
"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 verified successfully.",
"details": {}
}Successful Verification for Mobile Money (200)
{
"result": "success",
"transaction_id": "mp_1234567890",
"transaction_reference": "MOTAPAPAY1234567890",
"amount": "1000",
"charges": "10",
"total": "1010",
"currency": "USD",
"account_number": "0712345678",
"payment_method_name": "Mpesa",
"payment_method_code": "mpesa",
"payment_method_type": "mobile_money",
"message": "Transaction verified successfully."
}Successful Verification for Bank Transfer (200)
{
"result": "success",
"transaction_id": "mp_1234567890",
"transaction_reference": "MOTAPAPAY1234567890",
"amount": "1000",
"charges": "10",
"total": "1010",
"currency": "USD",
"account_number": "1234567890",
"payment_method_name": "Paystack",
"payment_method_code": "paystack",
"payment_method_type": "bank_transfer",
"message": "Transaction verified 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."
}