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"
    }
  ],
  "meta": {
    "cursor": "eyJpZCI6IjEyMyJ9",
    "hasPreviousPage": false,
    "hasNextPage": true
  }
}

Authorizations

Authorization
string
header
required

The API key to use for authentication

Query Parameters

q
string | null

Search for a customer by name or phone number

Example:

"John Doe"

cursor
string | null

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"

sortOrder
enum<string>
default:desc
Available options:
asc,
desc
Example:

"desc"

sortField
enum<string>
default:createdAt
Available options:
id,
name,
phoneNumber,
createdAt,
lastActiveAt
Example:

"createdAt"

Response

List of all customers

data
object[]
required
meta
object
required