curl --request POST \
--url https://api.example.com/api/v1/payments/test/checkout{
"status": "<string>",
"phone_number": "<string>",
"amount": 123,
"response": {
"status": "<string>",
"description": "<string>",
"transactionId": "<string>"
}
}Test the mobile money payment integration
curl --request POST \
--url https://api.example.com/api/v1/payments/test/checkout{
"status": "<string>",
"phone_number": "<string>",
"amount": 123,
"response": {
"status": "<string>",
"description": "<string>",
"transactionId": "<string>"
}
}+254712345678)# Test with specific phone and amount
curl -X POST "http://localhost:8000/api/v1/payments/test/checkout?phone_number=%2B254712345678&amount=50"
# Test with default amount (100 KES)
curl -X POST "http://localhost:8000/api/v1/payments/test/checkout?phone_number=%2B254712345678"
{
"status": "test_initiated",
"phone_number": "+254712345678",
"amount": 100.0,
"response": {
"status": "PendingConfirmation",
"description": "Waiting for user to confirm payment",
"transactionId": "ATPid_test123abc456"
}
}
{
"detail": "Payment test failed: Invalid phone number"
}
200 - Test payment initiated successfully500 - Test payment failed# Sandbox phone numbers (Kenya)
+254711XXXYYY # Replace XXX and YYY with any digits
# Test amounts that trigger specific responses
# 10-100 KES: Success
# 101-500 KES: User cancellation
# 501+ KES: Insufficient funds
{"test": "true"} to mark the transaction as a test. This helps identify test transactions in your database and Africa’s Talking dashboard.
mobile_checkout method with test metadata. Source: payments.py:203-227
Invalid phone number error
+2547123456780712345678No STK push received
Payment fails immediately
AT_API_KEY is set correctly