Simulate Express Payment.
The API key to use for authentication
The payment body details
Daraja Express Payment Request - flat structure combining customer and payment data
Amount transacted (KES). Only whole numbers are supported. Money that the customer pays to the Shortcode.
x <= 250000100
The description of the payment
1 - 13"Invoice #1234"
Customer phone number in format 254XXXXXXXXX (required if customerId is not provided)
"254712345678"
Existing customer ID - if provided, other customer fields are ignored
255"cus_GqfKXLmg61LURZhB"
Customer full name (ignored if customerId is provided)
1"John Doe"
Customer email address (ignored if customerId is provided)
5Customer description (ignored if customerId is provided)
1 - 255"VIP Customer"
Additional customer metadata (ignored if customerId is provided)
{
"user_preference": "dark_mode",
"last_login": 1640995200,
"is_premium": true,
"account_balance": 1250.75,
"notifications_enabled": false
}Account reference for the payment
1 - 12"moflay"
Additional payment metadata
{
"user_preference": "dark_mode",
"last_login": 1640995200,
"is_premium": true,
"account_balance": 1250.75,
"notifications_enabled": false,
"order_id": "ord_123456",
"invoice_number": "INV-2024-001",
"tax_amount": 16,
"discount_applied": false
}Payment Response
Daraja Express Payment Response
Current status of the transaction
pending, completed, failed "completed"
Response message
"Payment completed successfully"
Payment amount in the smallest currency unit (e.g., cents for KES)
1000
Platform fee charged for the transaction
x >= 015
Amount received by business after fees (amount - fee)
985
Transaction currency code
"KES"
Unique transaction identifier prefixed with 'trxn_'
"trxn_ABC123DEF456GHI"
Customer phone number used for payment
"254712345678"
Unique customer ID (existing or newly created) prefixed with 'cus_'
"cus_GqfKXLmg61LURZhB"
Account reference for the transaction (provided in request or auto-generated)
"store_001"
Environment where transaction was processed
sandbox, production "sandbox"
Transaction timestamp in ISO 8601 format
"2024-12-19T10:30:00.000Z"
Transaction description
"Payment for Order #12345"