GET
/
transactions
List Transactions
curl --request GET \
  --url https://api.mpesaflow.dev/transactions \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "trxn_YGZBY32PBBavYbhL",
      "customerId": "cus_GqfKXLmg61LURZhB",
      "object": "transaction",
      "environment": "development",
      "type": "payment",
      "amount": "1000",
      "currency": "KES",
      "status": "completed",
      "phoneNumber": "254712345678",
      "metadata": {},
      "failureReason": null,
      "createdAt": "2021-01-01T00:00:00Z",
      "paidAt": "2021-01-01T00:00:00Z",
      "failedAt": null
    }
  ],
  "next_cursor": "eyJpZCI6IjEyMyJ9",
  "limit": 10
}

Authorizations

Authorization
string
header
required

The API key to use for authentication

Query Parameters

q
string

Search for a transaction by customer name, phone number, or transaction id

Example:

"John Doe"

cursor
string

Cursor for pagination, representing the last item from the previous page

Example:

"eyJpZCI6IjEyMyJ9"

customerId
string

The customer id

Example:

"cus_12345"

statuses
enum<string>[]

Array of transaction statuses to filter by. Available statuses: 'pending', 'completed', 'failed'

Example:
["pending", "completed"]
amountRange
(number | null)[] | null

Amount range as [min, max] to filter transactions by monetary value

Example:
[100, 1000]
amount
string[] | null

Array of specific amounts (as strings) to filter transactions by exact values

Example:
["150.75", "299.99"]
limit
number
default:10

The number of transactions to return (1-100)

Required range: 1 <= x <= 100
Example:

10

start
string | null

Start date (inclusive) for filtering transactions in ISO 8601 format

Example:

"2024-04-01T00:00:00.000Z"

end
string | null

End date (inclusive) for filtering transactions in ISO 8601 format

Example:

"2024-04-30T23:59:59.999Z"

sort
enum<string>[]

Sorting order as a tuple: [field, direction]. Available fields: id, amount, status, createdAt, paidAt, failedAt. Direction must be: asc, desc

Required array length: 2 elements
Example:
["createdAt", "desc"]

Response

200
application/json

List of all transactions

The response is of type object.