Skip to main content
GET
/
v1
/
customers
List customers
curl --request GET \
  --url https://api-eu.flexportal.io/v1/customers \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-ID: <tenant-id>'
{
  "customers": [
    {
      "customerId": "<string>",
      "tenantId": "<string>",
      "email": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "customerType": "individual",
      "totalOrders": 123,
      "totalDevicesRented": 123,
      "totalMonthlyRevenue": 123,
      "status": "active",
      "orderIds": [
        "<string>"
      ],
      "rentalIds": [
        "<string>"
      ],
      "createdBy": "<string>",
      "company": "<string>",
      "phone": "<string>",
      "customFields": {},
      "lastBillingAddress": {
        "contactName": "<string>",
        "streetAddress": "<string>",
        "city": "<string>",
        "country": "<string>",
        "company": "<string>",
        "buildingInfo": "<string>",
        "locality": "<string>",
        "adminArea": "<string>",
        "postalCode": "<string>"
      },
      "lastShippingAddress": {
        "contactName": "<string>",
        "streetAddress": "<string>",
        "city": "<string>",
        "country": "<string>",
        "company": "<string>",
        "buildingInfo": "<string>",
        "locality": "<string>",
        "adminArea": "<string>",
        "postalCode": "<string>"
      },
      "createdAt": "<unknown>",
      "updatedAt": "<unknown>",
      "lifetimeCollected": 123,
      "totalAcquisitionCost": 123,
      "customerMargin": 123,
      "customerMarginPercent": 123,
      "subscriptionsTracked": 123
    }
  ],
  "count": 123,
  "limit": 123,
  "hasMore": true,
  "nextCursor": "<string>"
}

Overview

Retrieve a paginated list of customers with optional filtering and sorting. Customers are automatically created when orders are placed—you don’t need to create them separately.

Customer Creation

Customers are created automatically when:
  1. An order is placed with a new email address
  2. The system creates a customer record linked to that email
Subsequent orders with the same email are linked to the existing customer.

Common Use Cases

Customer Directory

Build customer management interfaces for your support or sales teams

CRM Integration

Sync customer data to external CRM systems like Salesforce or HubSpot

Reporting

Generate customer reports, segment customers, or analyze customer base

Support Lookup

Find customers by email or name to assist with support inquiries

Filtering Customers

# Get active customers
GET /v1/customers?status=active

# Find customer by email
GET /v1/customers?email=john@example.com

# Get business customers only
GET /v1/customers?customerType=business

# Get customers with active subscriptions
GET /v1/customers?hasActiveRentals=true

# Combine filters
GET /v1/customers?status=active&customerType=business&hasActiveRentals=true

Sorting Options

FieldDescription
createdAtCustomer creation date (default)
firstNameFirst name alphabetically
lastNameLast name alphabetically
emailEmail address alphabetically
totalMonthlyRevenueCurrent monthly revenue from this customer
totalDevicesRentedNumber of active subscriptions
# Sort by highest revenue customers
GET /v1/customers?sortBy=totalMonthlyRevenue&sortDir=desc

# Sort by most recent customers
GET /v1/customers?sortBy=createdAt&sortDir=desc

Response Fields

Key fields in each customer object:
FieldDescription
customerIdUnique customer identifier
emailCustomer email address
firstNameFirst name
lastNameLast name
companyCompany name (for business customers)
phonePhone number
customerTypeindividual or business
statusactive or inactive
totalDevicesRentedNumber of active subscriptions
totalMonthlyRevenueCurrent MRR from this customer
createdAtISO 8601 timestamp

Example: Find High-Value Customers

// Get top 10 customers by monthly revenue
const { customers } = await listCustomers({
  status: 'active',
  hasActiveRentals: true,
  sortBy: 'totalMonthlyRevenue',
  sortDir: 'desc',
  limit: 10
});

for (const customer of customers) {
  console.log(`${customer.firstName} ${customer.lastName}: €${customer.totalMonthlyRevenue}/mo`);
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Query Parameters

limit
string

Items per page (default: 50, max: 100)

startAfter
string

Cursor for pagination

status
string

Filter by status (active, inactive)

customerType
string

Filter by type (individual, business)

email
string

Filter by exact email match

Response

200 - application/json

List of customers

customers
object[]
required
count
number
required
limit
number
required
hasMore
boolean
required
nextCursor
string | null
required