Get a transaction in the business
The API key to use for authentication
Unique identifier for the transaction, prefixed with 'trxn_'
4 - 255"trxn_ABC123DEF456GHI"
Get One Transaction
Unique identifier for the transaction, prefixed with 'trxn_'
255"trxn_YGZBY32PBBavYbhL"
255Unique identifier for the customer, prefixed with 'cus_'. Unique identifier for the customer, prefixed with 'cus_'
4 - 255"cus_GqfKXLmg61LURZhB"
"transaction"
The environment of the transaction. Either 'sandbox' or 'production'
sandbox, production "sandbox"
The transaction currency
"KES"
Transaction amount in cents (e.g., 1000 = KES 10.00)
1000
Human-readable description of the transaction purpose
"Payment for Order #12345 - Premium Subscription"
Safaricom phone number in local (e.g., 0712345678, 0110123456) or international (e.g., 254712345678, 254110123456) format, transformed to 254XXXXXXXXX for M-PESA STK Push. Supports all Safaricom prefixes (070X, 074X, 0757–0759, 0768–0769, 079X, 0110–0115).
"254712345678"
Current status of the transaction. Possible values: pending, completed, failed, refunded
pending, completed, failed, refunded "completed"
The type of transaction
payment "payment"
The M-Pesa receipt number
50"QMF7MBB5ED"
Timestamp when the transaction was processed (ISO 8601 format)
"2024-12-19T10:30:00.000Z"
Timestamp when the transaction was successfully paid (ISO 8601 format)
"2024-12-19T10:32:00.000Z"
Timestamp when the transaction failed (ISO 8601 format)
"2024-12-19T10:33:00.000Z"
The transaction decline reason
"Insufficient balance"
Key-value object allowing you to store additional information.
Key Requirements:
Value Types:
Limits:
{
"user_preference": "dark_mode",
"last_login": 1640995200,
"is_premium": true,
"account_balance": 1250.75,
"notifications_enabled": false
}Timestamp when the transaction was created (ISO 8601 format)
"2024-12-19T10:25:00.000Z"
The source of the transaction. Either 'api' or 'dashboard'
api, dashboard, checkout "api"