Skip to main content
GET
/
v1
/
customers
List all customers
curl --request GET \
  --url https://api.moflay.com/v1/customers \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "cus_GqfKXLmg61LURZhB",
      "object": "customer",
      "environment": "sandbox",
      "name": "John Doe",
      "email": "johndoe@example.com",
      "phoneNumber": "254712345678",
      "description": "VIP customer with recurring payments",
      "countryCode": "KE",
      "isActive": true,
      "isVerified": true,
      "lastActiveAt": "2024-12-19T16:45:00.000Z",
      "firstTransactionAt": "2024-12-15T09:15:00.000Z",
      "preferredPaymentMethod": "m-pesa",
      "source": "api",
      "metadata": {
        "user_preference": "dark_mode",
        "last_login": 1640995200,
        "is_premium": true,
        "account_balance": 1250.75,
        "notifications_enabled": false
      },
      "createdAt": "2024-12-10T08:30:00.000Z",
      "updatedAt": "2024-12-19T14:22:00.000Z"
    }
  ],
  "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<date-time> | null

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

Example:

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

end
string<date-time> | null

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

Example:

"2024-12-31T23:59:59.999Z"

sortOrder
enum<string>
default:desc

The order in which to sort results. Defaults to 'desc'. Use 'asc' for ascending (oldest first) or 'desc' for descending (newest first).

Available options:
asc,
desc
Example:

"desc"

sortBy
enum<string>
default:createdAt

The field to sort results by. Defaults to 'createdAt'. Supported fields include any sortable customer property.

Available options:
createdAt,
name,
lastActiveAt,
countryCode,
email,
phoneNumber,
firstTransactionAt,
isActive,
isVerified
Example:

"createdAt"

Response

List of all customers

data
object[]
required
meta
object
required
I