Skip to main content
GET
/
v1
/
customers
/
{id}
Get a customer
curl --request GET \
  --url https://api.moflay.com/v1/customers/{id} \
  --header 'Authorization: Bearer <token>'
{
  "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"
}

Authorizations

Authorization
string
header
required

The API key to use for authentication

Path Parameters

id
string
required

Unique identifier for the customer, prefixed with 'cus_'.

Required string length: 4 - 255
Example:

"cus_GqfKXLmg61LURZhB"

Response

Get One Customer

id
string
required

Unique identifier for the customer, prefixed with 'cus_'

Maximum length: 255
Example:

"cus_GqfKXLmg61LURZhB"

object
string
required
Example:

"customer"

environment
enum<string>
required

The environment of the customer. Either 'sandbox' or 'production'

Available options:
sandbox,
production
Example:

"sandbox"

name
string | null
required

The name of the customer

Minimum length: 2
Example:

"John Doe"

email
string | null
required

The email of the customer

Example:

"johndoe@example.com"

phoneNumber
string
required

The phone number of the customer

Example:

"254712345678"

description
string | null
required

The description of the customer

Example:

"VIP customer with recurring payments"

countryCode
string
required

The country code of the customer

Maximum length: 2
Example:

"KE"

isActive
boolean
required

Whether the customer is active

Example:

true

isVerified
boolean
required

Whether the customer is verified

Example:

true

lastActiveAt
string | null
required

Timestamp when the customer was last active (ISO 8601 format)

Example:

"2024-12-19T16:45:00.000Z"

firstTransactionAt
string | null
required

Timestamp when the customer made their first transaction (ISO 8601 format)

Example:

"2024-12-15T09:15:00.000Z"

preferredPaymentMethod
string | null
required

The preferred payment method of the customer

Maximum length: 50
Example:

"m-pesa"

source
string | null
required

Source where the customer was created (api, dashboard, checkout, import)

Maximum length: 50
Example:

"api"

metadata
object
required

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
Example:
{
"user_preference": "dark_mode",
"last_login": 1640995200,
"is_premium": true,
"account_balance": 1250.75,
"notifications_enabled": false
}
createdAt
string
required

Timestamp when the customer was created (ISO 8601 format)

Example:

"2024-12-10T08:30:00.000Z"

updatedAt
string
required

Timestamp when the customer was last updated (ISO 8601 format)

Example:

"2024-12-19T14:22:00.000Z"

I