GET
/
customers
List all customers
curl --request GET \
  --url https://api.mpesaflow.dev/customers \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "cus_GqfKXLmg61LURZhB",
      "object": "customer",
      "environment": "development",
      "name": "John Doe",
      "phoneNumber": "254712345678",
      "createdAt": "2021-01-01T00:00:00Z",
      "lastActiveAt": "2021-01-01T00:00:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6IjEyMyJ9",
  "limit": 10
}

Authorizations

Authorization
string
header
required

The API key to use for authentication

Query Parameters

q
string

Search for a customer by name or phone number

Example:

"John Doe"

cursor
string

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

Example:

"eyJpZCI6IjEyMyJ9"

limit
number
default:10

The number of customers to return (1-100)

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

10

start
string | null

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

Example:

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

end
string | null

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

Example:

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

sort
enum<string>[]

Sorting order as a tuple: [field, direction]. Available fields: id, name, phoneNumber, createdAt, lastActiveAt

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

Response

200
application/json

List of all customers

The response is of type object.