Authorizations
The API key to use for authentication
Path Parameters
Unique identifier for the transaction, prefixed with 'trxn_'
4 - 255
"trxn_ABC123DEF456GHI"
Response
Get One Transaction
Unique identifier for the transaction, prefixed with 'trxn_'
255
"trxn_YGZBY32PBBavYbhL"
Unique identifier for the customer, prefixed with 'cus_'.
4 - 255
"cus_GqfKXLmg61LURZhB"
"transaction"
The environment of the customer. Either 'sandbox' or 'production' 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
The transaction fee
100
The transaction net amount
900
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. Only Safaricom numbers are supported.
"254712345678"
Current status of the transaction. Possible values: pending, completed, failed, refunded
pending
, completed
, failed
, refunded
"completed"
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:
- Must be a string
- Maximum length of 40 characters
Value Types:
- String (maximum 500 characters)
- Integer
- Floating-point number
- Boolean
Limits:
- Maximum of 50 key-value pairs
{
"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'
50
"api"
The type of transaction
payment
, donation
"payment"